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

Ambient Feedback

Make the world respond: the border colours by altitude, a thrust beep and a low-fuel warning chirp, and a fuel gauge you read at a glance instead of counting digits.

63% of Touchdown

The game plays, but it is silent and the numbers ask you to do arithmetic mid-descent. A real-time game should tell you how things are going without you having to read. This unit adds ambient feedback — colour and sound that track the state — and a visual fuel gauge, all from tools you already have.

  10 BORDER 0: PAPER 0: INK 7: CLS
  90 CLS
 100 LET alt = 100
 110 LET spd = 0
 120 LET fuel = 50
 130 PRINT AT 1, 1; "ALT:         SPD:      FUEL:"
 140 PRINT AT 21, 0; "================================"
 150 LET spd = spd + 1
 160 IF INKEY$ = " " AND fuel > 0 THEN LET spd = spd - 2: LET fuel = fuel - 1: BEEP 0.02, 15
 170 IF spd < 0 THEN LET spd = 0
 180 LET prev = alt
 190 LET alt = alt - spd
 200 IF alt <= 0 THEN LET alt = 0
 210 PRINT AT 1, 6; alt; "  "
 220 PRINT AT 1, 18; spd; "  "
 230 PRINT AT 1, 29; fuel; "  "
 240 REM Fuel bar
 250 PRINT AT 2, 1;
 260 FOR j = 1 TO fuel: PRINT INK 4; "*";: NEXT j
 270 FOR j = fuel + 1 TO 50: PRINT " ";: NEXT j
 290 IF alt > 70 THEN BORDER 1
 300 IF alt > 40 AND alt <= 70 THEN BORDER 5
 310 IF alt > 20 AND alt <= 40 THEN BORDER 6
 320 IF alt > 10 AND alt <= 20 THEN BORDER 2
 330 IF alt <= 10 THEN BORDER 7
 340 IF fuel < 10 AND fuel > 0 THEN BEEP 0.02, 30
 360 LET row = 20 - INT (alt / 5)
 370 IF row < 4 THEN LET row = 4
 380 IF row > 20 THEN LET row = 20
 390 LET prow = 20 - INT (prev / 5)
 400 IF prow < 4 THEN LET prow = 4
 410 IF prow > 20 THEN LET prow = 20
 420 PRINT AT prow, 15; " "
 430 PRINT AT row, 15; "V"
 440 PAUSE 3
 450 IF alt = 0 AND spd <= 2 THEN PRINT AT 10, 8; "PERFECT LANDING!": STOP
 460 IF alt = 0 AND spd <= 5 THEN PRINT AT 10, 8; "Bumpy but safe": STOP
 470 IF alt = 0 AND spd > 5 THEN PRINT AT 10, 8; "CRASH!": STOP
 480 GO TO 150
ZX Spectrum Touchdown with a blue border, a green fuel bar of asterisks across the top, the dashboard, and the lander descending
The border colours with altitude, and a bar of asterisks shows the fuel at a glance.

The border as an altimeter

Lines 290–330 set the BORDER colour from the altitude: blue up high, cyan, yellow, then red as the ground rushes up, white at the last moment. You are not meant to read it — you feel the screen flush toward red and know, without checking ALT, that you are running out of sky. Colour carrying state at the edge of your attention is what "ambient" means.

Sound that tracks the state

Two beeps, two jobs. Line 160 now ends with BEEP 0.02, 15 — a tick on every thrust, so you hear the engine fire. Line 340 — IF fuel < 10 AND fuel > 0 THEN BEEP 0.02, 30 — chirps a higher warning once the tank drops below ten, nagging you exactly when fuel matters most. Both are the BEEP from Meet BASIC, placed where the game needs to speak.

A gauge, not a number

Lines 250–270 draw the fuel as a bar: a FOR loop prints one asterisk per unit of fuel, then a second loop pads the rest with spaces to rub out the bar as it shrinks. A shortening row of stars reads instantly — full, half, nearly gone — in a way "FUEL: 17" never can. It is the bar chart idea from Dice Roller, doing a job in the middle of a live game.

Next: turn the three endings into real events, and give the game a front door.