11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Run it. It puts a white diamond on a red screen. The diamond runs up and down theright side of the screen. It goes when you press fl or f3. Otherwise it stops.Line 50 looks into the keyboard's box.Line 55 says, "If no keys are being pressed, set D to zero." D is how much the diamond'sscreen address will change before the diamond is next put onto the screen.Line 60 tests to see if the fl key is being pressed. If it is, D is set to -40. This means thenext diamond will be put one line higher than the present diamond.Line 65 sets D to 40 if f3 is being pressed. It means the diamond will be POKEd one linelower next time.Line 90 erases the old diamond by putting a space (character 32) onto its screen spot.Lines 130 and 140 do another bit of housekeeping. They check the value of Y (the addressof the diamond on the screen) to make sure that the diamond will not try to move off thetop or bottom of the screen.Line 170 POKEs the new diamond onto the screen, and the cycle starts again.SHOOTING ARROWSWe want the diamond to shoot arrows when we press the "Q" key.Why pick Q? Two reasons:First, Q is in a comfortable spot for the left hand to control shooting while the right handcontrols motion.Second, Q has number 58, higher than fl or f3, so even if two keys are pressed at once, anarrow will shoot. (Be careful to not hold the Q key down, or else the fl and f2 keys willnot control the diamond.)Add these lines:28 S=0:X=Y70 IF K=62 AND S=0THEN S=175 IF S< >0 THEN GOSUB 300300 REM SHOOT310 IF S=1 THEN X=Y-1 :POKE X.31 :S=2:RETURN315 POKEX.32316 IF S=38 THEN S=0:RETURN320X=X-1:S=S+1330 POKE X.31399 RETURN161

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

Saved successfully!

Ooh no, something went wrong!