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

Colour the Feedback

Words are slow; colour is instant. Make the background warm red when the guess is too high and cool blue when it's too low, behind a safe drawn on screen. The player reads the safe's mood before they read a word — colour carrying meaning, not decoration.

83% of Safe Cracker

The safe answers in words, but the player feels colour faster than they read. So let the screen say the hint before the text does: warm red when the guess is too high, cool blue when it's too low. And give the safe a face — a door drawn on screen — so the game looks like what it is.

10 S=INT(RND(1)*100)+1
20 BG=6
30 POKE 53281,BG:GOSUB 500
40 INPUT "YOUR GUESS";G
50 IF G=S THEN POKE 53281,5:GOSUB 500:PRINT "CRACKED IT!":END
60 IF G<S THEN BG=14:H$="THE CODE IS HIGHER"
70 IF G>S THEN BG=2:H$="THE CODE IS LOWER"
80 POKE 53281,BG:GOSUB 500
90 PRINT H$
100 GOTO 40
500 PRINT CHR$(147)
510 PRINT "********************"
520 PRINT "*    S A F E       *"
530 PRINT "*    CRACKER       *"
540 PRINT "*                  *"
550 PRINT "*    ( DIAL )      *"
560 PRINT "********************"
570 PRINT
580 RETURN
A C64 screen with a red background: a safe drawn in asterisks, THE CODE IS LOWER, and a fresh YOUR GUESS prompt.
The safe answers in colour: a guess of 50 turned the screen red — too high — before the words even land. Red for over, blue for under; the mood arrives first.

Two ideas join here. The safe is the routine at line 500: it clears the screen and draws a door out of asterisks — a frame the game lives inside, redrawn each guess so the screen stays a dial, not a scroll. And the colour is the feedback: a variable BG holds the background colour, set red (2) when the guess is too high and blue (14) when too low, then written with POKE 53281,BG — the background register you met in the primer.

The order is the trick. The screen changes colour before the hint prints, so the player reads the safe's mood — hot or cold — in an instant, then confirms it in words. On a crack, line 50 turns the background green and opens the safe. Colour here isn't decoration; it carries the hint, the same job it did for Oracle's moods, now tied to "too high" and "too low".

Try this

  • Warmer as you near it. Instead of a flat red, set BG from how close the guess is — BG = 2 when within 5, orange further out, blue when miles off. The screen then warms as the player closes in.
  • Redraw the dial. The safe in line 500 is plain asterisks. Add a row of dial marks, or a bigger door — the frame is yours to dress.

What's next

The safe has a face and a mood, but the player can guess forever. In Unit 6 the guesses run out — a limit, a lose state, and a stake that turns the hunt into a game you can fail.