Thrust Pushes Back
Gravity has it all its own way — until now. Read a key inside the loop, and when it's pressed, shrink the velocity. Press to slow the fall; release and gravity takes over. Two forces on one variable: the game exists the moment you can fight back.
So far you watch the lander fall and can do nothing. Time to fight back. Read a key on every pass of the loop, and when it's pressed, fire the thruster — push against the fall by shrinking the velocity. The instant you can do that, Dropzone becomes a game.
10 POKE 53281,0:PRINT CHR$(147)
20 C=20:Y=1:V=0:G=0.02:TH=0.06
30 R=INT(Y)
40 POKE 1024+R*40+C,81:POKE 55296+R*40+C,1
50 GOSUB 500
60 FOR D=1 TO 30:NEXT D
70 POKE 1024+R*40+C,32
80 V=V+G
90 GET A$:IF A$<>"" THEN V=V-TH
100 Y=Y+V
110 IF Y<1 THEN Y=1:V=0
120 IF Y>21 THEN END
130 GOTO 30
500 POKE 646,1:PRINT CHR$(19);"SPEED:";INT(V*100);" "
510 RETURN
The new line is line 90: GET A$: IF A$<>"" THEN V=V-TH. You met GET in Reflex and Bleeper —
it reads the keyboard without stopping the loop. Here, each tap puts a key in A$, and TH (the
thrust strength) is subtracted from the velocity. Gravity still adds G every loop on line 80;
thrust takes TH away whenever you press. Two forces, pulling the one number V in opposite
directions.
That tug-of-war is the entire game. Because TH is bigger than G, a press wins the moment — the
lander slows, even rises. Let go and gravity, adding patiently every loop, takes back over. The
readout shows it: tap and the speed drops; wait and it climbs. You're not moving the lander
directly any more — you're managing the forces on it. (Line 110 just stops it drifting off the
top of the screen.)
Try this
- Stronger or gentler.
TH = 0.06on line 20 is how hard each tap pushes. Raise it for a punchy thruster, lower it for a delicate one. The feel of the whole game lives in that number againstG. - Hold it up. Tap steadily and try to keep the lander hovering — speed near zero, neither falling nor rising. That balance is the skill the landing will demand.
What's next
You can fight gravity, but there's nowhere to land — the lander just drifts. In Unit 4 a ground line and a coloured pad give the descent a target.