Skip to content
Michael Lizzio

Warm Cold Square

A two-day Pygame game: find the hidden square without hitting a bomb

  • Python
  • Pygame
  • Manhattan distance
  • Pygbag

June 2022Complete

Warm Cold Square game in progress with a Warm clue above a field of small red bombs
An easy round. The target stays hidden until you find it or hit a bomb.
What it is
A Pygame game where a green square is hidden on the screen, and the only hint is a word like Warm or Cold that changes as your mouse gets closer. Touch a red bomb and you lose.
Why I made it
My cousin Justin and I wanted a quick challenge, like a mini hackathon: take a simple hot-and-cold idea and finish it in two days.
What I did
We built the menu, three difficulty levels, the distance-to-temperature words and random bomb fields that stay away from the target. Later I made a version that runs in the browser.
How it turned out
We finished it in two days in June 2022. Hard mode shrinks the target to the size of one bomb and puts 750 bombs on the screen.

The details

A two-day challenge

Warm Cold Square fullscreen menu with Play, Easy, and Quit buttons on a black background
The menu: play, pick a difficulty, or quit.

Justin and I treated it like a mini hackathon: take a simple hot-and-cold idea, make it playable, and finish in two days. So it's pretty simple: one menu, one screen of bombs, and a rule you get as soon as the word starts changing.

The middle button on the menu switches between easy, medium and hard, and every round makes a new target and a new field of bombs.

Turning distance into temperature

Warm Cold Square win screen showing Burning, a green hidden target, the word Won, time, and score
Found it. The target turns green and you get a time and score.

Every frame, the game works out how far the mouse is from the target, counting across and up and down separately. That distance turns into one of six words, from Burning down to Fridge, each in its own color. Find the square and it shows up green with your time and score. Touch a bomb and you lose.

Harder means more bombs

Warm Cold Square hard-mode loss with hundreds of red bombs, the revealed green target, and a large Lost message
A hard round, lost on one of 750 bombs.

Easy hides a big target among 100 bombs. Hard shrinks the target to the same size as a single bomb and puts 750 of them on screen. The bombs are placed randomly but kept away from the target and from where your mouse starts, so every round is a different maze.

Built for any screen

Everything is drawn with plain Pygame rectangles and text, sized from the screen's resolution, so it fills whatever display it runs on. Later I made a version that runs in the browser too.