The flight works. Give someone opening the game for the first time enough information to start, recognise the controls and understand what the readout means.
Replace line 10.
Add lines 5000, 5010, 5020, 5030, 5040, 5050, 5060, 5070, 5080, 5090, 5100, 5110, 5120, 5130.
10 GO SUB 7000: GO SUB 5000
5000 BORDER 0: PAPER 0: INK 7: CLS
5010 PRINT AT 3,13; INK 5;"DRIFT"
5020 PRINT AT 6,3;"Space has no brakes."
5030 PRINT AT 8,3;"O/P turn. SPACE fires thrust."
5040 PRINT AT 10,3;"Release thrust: keep drifting."
5050 PRINT AT 12,3;"Turn back and burn to brake."
5060 PRINT AT 14,3;"DOCK OK means slow enough."
5070 PRINT AT 16,3;"DRIFT: E/W and N/S motion."
5080 PRINT AT 18,3;"R retries. Q quits."
5090 PRINT AT 20,11; INK 6;"S starts."
5100 LET k$=INKEY$
5110 IF k$="q" OR k$="Q" THEN GO TO 9000
5120 IF k$<>"s" AND k$<>"S" THEN GO TO 5100
5130 RETURNRUN the changed program.
Complete source at this checkpoint
10 GO SUB 7000: GO SUB 5000
100 LET x=48: LET y=56: LET vx=0: LET vy=0: LET h=2: LET steps=0
110 GO SUB 1000: GO SUB 3000: GO SUB 6000
200 LET k$=INKEY$
210 IF k$="q" OR k$="Q" THEN GO TO 9000
220 IF k$="r" OR k$="R" THEN GO TO 100
230 GO SUB 3000
240 IF k$="o" OR k$="O" THEN LET h=h+1
250 IF k$="p" OR k$="P" THEN LET h=h-1
260 IF h=9 THEN LET h=1
270 IF h=0 THEN LET h=8
280 IF k$<>" " THEN GO TO 320
290 LET vx=vx+.2 *a(h): LET vy=vy+.2 *b(h)
300 LET speed=SQR (vx*vx+vy*vy)
310 IF speed>3 THEN LET vx=3 *vx/speed: LET vy=3 *vy/speed
320 LET nx=x+vx: LET ny=y+vy
330 IF nx<22 OR nx>233 OR ny<30 OR ny>145 THEN GO SUB 3000: LET e$="Hull lost. Try a gentler burn.": GO TO 4000
340 LET x=nx: LET y=ny: LET steps=steps+1
350 GO SUB 3000
355 IF k$=" " THEN GO SUB 6000
360 IF x>=190 AND x<=210 AND y>=94 AND y<=114 AND vx*vx+vy*vy<=.16 THEN LET e$="Docked. A soft arrival!": GO TO 4000
370 GO TO 200
1000 BORDER 0: PAPER 0: INK 7: CLS
1010 PRINT AT 0,2; INK 5;"DRIFT";AT 0,19; INK 7;"SOFT DOCK"
1020 PRINT AT 1,2;"SPEED"
1030 PLOT INK 1;15,24: DRAW INK 1;0,128: DRAW INK 1;225,0: DRAW INK 1;0,-128: DRAW INK 1;-225,0
1040 PLOT INK 7;184,88: DRAW INK 7;32,0: DRAW INK 7;0,32: DRAW INK 7;-32,0: DRAW INK 7;0,-32
1050 PRINT AT 5,23; INK 5;"DOCK"
1060 PRINT AT 19,2; INK 5;"O/P turn SPACE thrust"
1070 PRINT AT 20,2; INK 7;"DRIFT"
1080 PRINT AT 21,2; INK 5;"R retry Q quit";
1090 RETURN
3000 LET px=INT (x+.5): LET py=INT (y+.5)
3010 PLOT INK 7; OVER 1;px+c(h),py+d(h)
3020 DRAW INK 7; OVER 1;e(h)-c(h),f(h)-d(h)
3030 DRAW INK 7; OVER 1;g(h)-e(h),j(h)-f(h)
3040 DRAW INK 7; OVER 1;c(h)-g(h),d(h)-j(h): RETURN
4000 PRINT AT 1,0;" ";AT 1,2; INK 6;e$
4010 PRINT AT 20,2;"R plays again. Q quits. "
4020 IF INKEY$<>"" THEN GO TO 4020
4030 LET k$=INKEY$
4040 IF k$="q" OR k$="Q" THEN GO TO 9000
4050 IF k$="r" OR k$="R" THEN GO TO 100
4060 GO TO 4030
5000 BORDER 0: PAPER 0: INK 7: CLS
5010 PRINT AT 3,13; INK 5;"DRIFT"
5020 PRINT AT 6,3;"Space has no brakes."
5030 PRINT AT 8,3;"O/P turn. SPACE fires thrust."
5040 PRINT AT 10,3;"Release thrust: keep drifting."
5050 PRINT AT 12,3;"Turn back and burn to brake."
5060 PRINT AT 14,3;"DOCK OK means slow enough."
5070 PRINT AT 16,3;"DRIFT: E/W and N/S motion."
5080 PRINT AT 18,3;"R retries. Q quits."
5090 PRINT AT 20,11; INK 6;"S starts."
5100 LET k$=INKEY$
5110 IF k$="q" OR k$="Q" THEN GO TO 9000
5120 IF k$<>"s" AND k$<>"S" THEN GO TO 5100
5130 RETURN
6000 LET speed=SQR (vx*vx+vy*vy)
6010 PRINT AT 1,8; INK 7;INT (10 *speed+.5)/10;" "
6020 IF vx*vx+vy*vy<=.16 THEN PRINT AT 1,17; INK 4;"DOCK OK "
6030 IF vx*vx+vy*vy>.16 THEN PRINT AT 1,17; INK 6;"TOO FAST"
6040 LET u$="E": LET w$="N"
6050 IF vx<-.001 THEN LET u$="W"
6060 IF vy<-.001 THEN LET w$="S"
6070 IF ABS vx<.001 THEN LET u$="-"
6080 IF ABS vy<.001 THEN LET w$="-"
6090 PRINT AT 20,8; INK 7;u$;" ";INT (10 *ABS vx+.5)/10;" ";AT 20,16;w$;" ";INT (10 *ABS vy+.5)/10;" ": RETURN
7000 DIM a(8): DIM b(8): DIM c(8): DIM d(8): DIM e(8): DIM f(8): DIM g(8): DIM j(8)
7010 FOR i=1 TO 8: LET angle=(i-1)*PI/4
7020 LET a(i)=COS angle: LET b(i)=SIN angle
7030 LET c(i)=INT (5 *a(i)+.5): LET d(i)=INT (5 *b(i)+.5)
7040 LET e(i)=INT (-3 *a(i)-3 *b(i)+.5): LET f(i)=INT (-3 *b(i)+3 *a(i)+.5)
7050 LET g(i)=INT (-3 *a(i)+3 *b(i)+.5): LET j(i)=INT (-3 *b(i)-3 *a(i)+.5)
7060 NEXT i: RETURN
9000 PAPER 0: INK 7: PRINT AT 21,0;"Finished. RUN to try again. ";: STOPRUN now opens a title screen. Press S to start, then play the same docking challenge. Q can also leave directly from the title.

Prepare once, start each flight
Line 10 calls the direction-table routine at 7000, then the title routine at 5000. When S is read, RETURN takes execution back to line 10. With no further statement there, BASIC continues at line 100 to reset the flight.
The table describes the eight fixed orientations and can be reused. R goes straight to 100: it resets position, velocity, heading and steps, then redraws the arena. It does not need to calculate the direction table again or return to the title.
The title says “Space has no brakes.” Here that means there is no automatic slowing or dedicated brake control. The following instructions explain the action we do have: turn back and thrust against the motion.
Read one key at a time
The title loop waits for S or Q. The flight loop uses O/P for turning and SPACE for thrust. Each loop reads one string from INKEY$, so this game’s controls are separate actions: turn, release, then thrust. It does not promise simultaneous turning and burning.
Both upper- and lower-case letters are accepted. The result loop first waits for release and then listens for R/Q. After Q, the final STOP leaves you at the BASIC prompt; RUN begins with the title again.
Why does R jump to line 100 while RUN begins at line 10?
Show the explanation
R needs a fresh flight, using the direction table already in memory. RUN begins the whole program: it constructs the table, shows the title, then starts a flight. Starting at 100 on a fresh machine would skip the array setup.
Try the whole cycle: title, start, wall failure, retry, successful docking and quit. Take time over the successful approach; the point of this check is that every route leaves the program ready for the next action.
If retry shows the old result or leaves the old ship behind, inspect the call to the screen routine at line 110: its CLS clears the previous flight before drawing the arena. If S never begins, check the title’s two accepted forms and its RETURN.
You now have the complete game: eight headings, thrust, coasting, a speed limit, readable motion and one soft docking challenge. We will keep this version and save it so a fresh Spectrum can run it too.
Sources
Steven Vickers, edited by Robin Bradbeer, ZX Spectrum BASIC Programming, second edition (Sinclair Research, 1983), chapter 5, chapter 18. Chapter 5 describes GO SUB and RETURN; chapter 18 describes INKEY$. The title and retry paths here are part of this program.
Run it here
This unit's program, built for you.
- Program
- drift.tap
- Machine
- ZX Spectrum 48K (PAL)