Skip to content
Game 8 Unit 1 of 6 1 hr learning time

A Falling Dot

Every lander game starts with something that falls. Hold an altitude in a variable, increase it each loop, and draw the lander at the row it points to — erase-move-draw, falling on its own whether you act or not. The continuous loop that drives every real-time game.

17% of Dropzone

A lander game begins with one thing: something that falls, on its own, whether you touch the controls or not. So start there — a dot that drops down the screen in a loop that never waits for you. That self-running loop is the engine of every real-time game.

10 POKE 53281,0:PRINT CHR$(147)
20 C=20:Y=1
30 R=INT(Y)
40 POKE 1024+R*40+C,81:POKE 55296+R*40+C,1
50 FOR D=1 TO 60:NEXT D
60 POKE 1024+R*40+C,32
70 Y=Y+0.5
80 IF Y>21 THEN END
90 GOTO 30
A C64 screen, black background, a single white dot partway down the centre.
The lander, falling. It started at the top and the loop has carried it halfway down — no input, no waiting, just a position that grows and a dot redrawn each pass.

The lander's height lives in Y, set near the top on line 20. The loop draws it and drops it. Line 30 turns Y into a row with R = INT(Y); line 40 POKEs the dot into screen RAM there. Then line 60 holds it a moment, line 70 erases it, and line 70's partner — Y = Y + 0.5 — moves it down half a row. Back to line 30, and the dot is drawn one step lower. That's erase-move-draw, the technique from Rover, now carrying a falling craft.

The key idea is that the loop runs on its own. There's no INPUT, no waiting for a key — the machine updates the lander every pass and the dot falls whether you watch or not. That's a continuous game loop, and it's the difference between a real-time game and the turn-by-turn programs that came before. Everything in Dropzone hangs off it.

Try this

  • Change the pace. The fall speed is the 0.5 on line 70. Make it 0.2 for a slow drift or 1 for a quick drop. Tune it until it reads as falling, not stepping.
  • Start it higher or lower. Change Y=1 on line 20. The lander begins wherever you point it, then the loop takes over.

What's next

The dot falls at a constant speed — but real gravity makes things speed up as they drop. In Unit 2 velocity becomes its own variable that gravity grows every loop, and the fall gains weight.