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

Make It a Game

Give Rover a front door. A title screen with the rover's name and a fire-to-start — read fire with (J AND 16) — turns the program into a game someone can pick up and play. Your finished Rover, ready to drive.

100% of Rover

The game plays, the board clears — but it begins the moment you type RUN, with no welcome. A real game has a front door: a title that names it and waits for you to choose to start. Add one, read the fire button to begin, and Rover becomes something you'd hand to a friend.

10 POKE 53281,0:PRINT CHR$(147):POKE 646,7
12 PRINT:PRINT:PRINT:PRINT "          R O V E R"
14 PRINT:PRINT:PRINT "     COLLECT EVERY PICKUP"
16 PRINT:PRINT:PRINT "     PUSH FIRE TO START"
18 J=PEEK(56320):IF (J AND 16)<>0 THEN 18
20 PRINT CHR$(147):GOSUB 500
30 SC=0:NP=4:GOSUB 700
40 R=4:C=5
50 POKE 1024+R*40+C,160:POKE 55296+R*40+C,7
60 J=PEEK(56320)
70 NR=R:NC=C
80 IF (J AND 1)=0 THEN NR=R-1
90 IF (J AND 2)=0 THEN NR=R+1
100 IF (J AND 4)=0 THEN NC=C-1
110 IF (J AND 8)=0 THEN NC=C+1
120 IF NR=R AND NC=C THEN 60
130 TC=PEEK(1024+NR*40+NC)
140 IF TC=160 THEN 60
150 IF TC=81 THEN SC=SC+10:NP=NP-1:GOSUB 700
160 POKE 1024+R*40+C,32
170 R=NR:C=NC
180 POKE 1024+R*40+C,160:POKE 55296+R*40+C,7
185 IF NP=0 THEN 900
190 GOTO 60
500 FOR C=1 TO 38
510 POKE 1024+40+C,160:POKE 55296+40+C,1
520 POKE 1024+23*40+C,160:POKE 55296+23*40+C,1
530 NEXT C
540 FOR R=1 TO 23
550 POKE 1024+R*40+1,160:POKE 55296+R*40+1,1
560 POKE 1024+R*40+38,160:POKE 55296+R*40+38,1
570 NEXT R
580 FOR R=3 TO 12:POKE 1024+R*40+19,160:POKE 55296+R*40+19,1:NEXT R
590 FOR C=8 TO 30:POKE 1024+16*40+C,160:POKE 55296+16*40+C,1:NEXT C
600 POKE 1024+4*40+8,81:POKE 55296+4*40+8,3
610 POKE 1024+4*40+11,81:POKE 55296+4*40+11,3
620 POKE 1024+4*40+14,81:POKE 55296+4*40+14,3
630 POKE 1024+4*40+17,81:POKE 55296+4*40+17,3
650 RETURN
700 POKE 1024+1,19:POKE 1024+2,3:POKE 1024+3,15:POKE 1024+4,18:POKE 1024+5,5
710 FOR I=1 TO 5:POKE 55296+I,7:NEXT I
720 S$=STR$(SC)
730 FOR I=1 TO LEN(S$)
740 POKE 1024+6+I,ASC(MID$(S$,I,1)):POKE 55296+6+I,7
750 NEXT I
760 RETURN
900 PRINT CHR$(147):POKE 53281,5:POKE 646,1
910 PRINT "ALL CLEAR!"
920 PRINT "FINAL SCORE: ";SC
930 END
A C64 title screen on black: ROVER, COLLECT EVERY PICKUP, PUSH FIRE TO START, in yellow.
The front door: the rover's name, what to do, and a prompt to begin. The game waits here, reading the fire button, until the player decides to drive.

The title is lines 10–18. Lines 12–16 print the name and the instructions; line 18 is the wait: J = PEEK(56320): IF (J AND 16) <> 0 THEN 18. That's the same joystick read as the movement loop, but testing bit 16 — the fire button. Fire is active-low like the directions, so (J AND 16) = 0 means it's pressed; while it isn't pressed the line loops back to itself, holding on the title. Push fire and the program falls through, clears the screen, and the game you built begins.

That single read is the whole front door — the rover's controller now starts the game as well as drives it. Everything below is the game from the last five units, unchanged: the maze, the joystick loop, the look-ahead collision, the pickups, the score, the clear-the-board finish.

That's Rover. A craft you drive in real time with PEEK(56320), a maze drawn into the screen that stops it with look-ahead PEEK collision, pickups that score, a board to clear, and a title that welcomes a player in. The machine answers you the instant you move — the foundation every action game is built on.

Try this

  • Make the maze yours. This is your game now — redesign the walls, place the pickups deliberately, pick the colours and the move rate. Build a level you're proud to show.
  • Show someone. Hand them the stick and watch them drive. The rover is a toy you built that another person can pick up and play — the real test of a game.

What's next

You've built real-time control and collision. Next comes the capstone of Volume 1 — Dropzone — where the rover's steady step gives way to velocity: gravity pulls, thrust fights it, and you fly a lander down to a safe touchdown.