ES-119ESP32IntermediatePremium

ESP32 ST7789 Colour Snake Game: The Classic Snake You Play with a Joystick, That Speeds Up and Remembers the High Score

Build the legendary game from old mobile phones yourself. The ESP32 draws a checkered playfield on a 240 x 240 colour ST7789 display and you steer the snake with a joystick. Every apple makes the snake one cell longer, raises the score and speeds the game up a little. The body flows in rainbow colours. Hitting a wall or yourself ends the game; the high score stays in the permanent memory of the ESP32. A buzzer plays the eat, crash and record sounds. Uses the Adafruit ST7789 library.

0.0(0)
ESP32 ST7789 Colour Snake Game: The Classic Snake You Play with a Joystick, That Speeds Up and Remembers the High Score
Make a real handheld game with a real stick that fits on your desk or in your bag, and start a high score contest with your friends. You learn to drive a colour TFT display over SPI, to draw only the cells that change so nothing flickers, to keep the snake in a ring buffer, to read both axes of a joystick as analog values, to build a game loop with millis instead of waiting, to play tunes without waiting and to save the high score in memory that survives a power cut.

Source Code

Premium Content

The source code, block version and FAQ of this project are open to Premium members.

  • All Project Code
  • Block version
  • Frequently Asked Questions