Skip to content
Game 4 8 Units

Hot and Cold

A grid search game — find the hidden treasure by reading the border colour.

Red border — getting warmer, the treasure is nearby

A treasure is hidden somewhere on screen. You can’t see it — but the border knows where it is. Move your cursor with Q/A/O/P and watch the colour shift. Blue means cold, far away. Red means warm, getting closer. Yellow means burning hot, almost there. Find all five treasures in the fewest moves you can.

Results screen with total moves and a rating

What You’ll Learn

  • The game loop — read input, update state, draw, repeat — the pattern behind every game
  • Position variables — using r and c to track where something is and move it
  • Q/A/O/P movement — the standard Spectrum control scheme
  • ABS — calculating distance without caring about direction
  • PRINT AT for game screens — building on what you learnt in Game 2 to create a full interactive grid
  • FOR/NEXT for rounds — wrapping a game in a loop with scoring

Prerequisites

Complete Game 3: Colour Flood first. You’ll need FOR/NEXT, INK, PAPER, BORDER, BRIGHT, and PRINT AT (which you first used in Game 2).

Unit Roadmap

8 of 8 units available