17.01.2013 Views

AmstradCPC6128-hypertext-en-Sinewalker

AmstradCPC6128-hypertext-en-Sinewalker

AmstradCPC6128-hypertext-en-Sinewalker

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

JOY<br />

JOY ( )<br />

10 PRINT "To stop the program - If;<br />

20 PRINT "operate joystick"<br />

30 IF JOY(0)0 THEN END<br />

40 GOTO 10<br />

run<br />

FUNCTION: Reads a bit-significant result from the JOY stick specified in the<br />

(either 0 or 1).<br />

Bit Decimal<br />

O:Up 1<br />

1: Down 2<br />

2: Left 4<br />

3: Right 8<br />

4: Fire 2 16<br />

5: Fire 1 32<br />

H<strong>en</strong>ce for example, if the main 'fire' button (Fire 2) on the first joystick is pressed<br />

while the joystick handle is· being '-moved left, the function JOY ( 0) returns a<br />

decimal value of20, corresponding to 16 (Fire 2) + 4 (Left).<br />

Further information concerning joysticks will be found in the chapter <strong>en</strong>titled 'For<br />

your refer<strong>en</strong>ce .... '.<br />

Associatedkeywords: C LE A R IN PU T, IN KE Y<br />

I{EY<br />

KEY , <br />

KEY 11,"border 13:paper 0:p<strong>en</strong> 1:ink 0,13:<br />

ink 1,0:mode 2:list"+CHR$(13)<br />

.... now press the [ENTER] key.<br />

COMMAND: Assigns the to the key's <br />

specified. Thirty-two expansion tok<strong>en</strong>s are supported, in the range 0 to 31, these<br />

occupying the key values 128 to 159. Keys 128 (0 on numeric keypad) to 140<br />

([CONTROL] [ENTER]) are by default assigned to print numbers 0 to 9, a decimal<br />

point, [RETURN] and RUN" [RETURN] - (for cassette operation), but may be<br />

re-assigned to other s as required. Expansion tok<strong>en</strong>s 13 to 31 (key<br />

values 141 to 159) are empty strings by default, but may be be expanded and assigned<br />

to keys, using the KEY DE F command described in the next example.<br />

Complete List of Keywords Chapter 3 Page 37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!