๐ŸŽฎ Turning a 31ร—31 LED Matrix Into a Retro Game Console

During a department music event, our seniors (CSEโ€™22 batch) built a giant 31ร—31 LED matrix with 961 colorful bulbs to display synchronized light patterns. After the event, it was left unused, so I decided to turn it into a playable Snake game.


๐Ÿ’ก The Vision

My goal: transform this sound-reactive wall into a modular retro LED game console. I wanted to:

  • ๐ŸŽฎ Add more games over time
  • ๐Ÿ–ฅ๏ธ Simulate the display on a PC (for development without hardware)
  • ๐Ÿงฉ Keep the code modular so others can contribute

โš™๏ธ Architecture Overview

The system uses three threads:

  • Render Thread: Sends visuals to the LED matrix
  • Game Thread: Runs game logic (Snake, Galaxia, Tetris, etc.)
  • Input Thread: Handles user input via a web controller (your phone can be the D-pad)

All threads share a 31ร—31 framebuffer:

<pixel type> framebuffer[31][31];

Games write to this array; the renderer displays it on the LEDs or in a web browser. This separation makes adding new games easy, no changes to rendering needed.


๐Ÿ Playing Snake on a Wall of Lights

Hereโ€™s Snake running on the LED wall! (Press play below.)

๐Ÿ Snake slithers around the grid, eating food and growing.
๐Ÿ’ฅ Game over if it crashes into itself.
โฉ Speed increases as you score.
๐ŸŽฏ Score appears in the center at the end.
Nostalgic fun, on a glowing 961-pixel canvas.

๐Ÿงช PC Simulation Mode

To develop without the hardware, I built a web-based simulator:

  • The ESP32 serves the framebuffer as JSON
  • A web UI fetches and displays it in real time

Same code, same framebuffer, just a different display!


๐ŸŒŒ Adding More Games

After Snake, I added:

  • Galaxia: A pixel space shooter
  • Tetris: Classic falling blocks

All games use the same pattern: write to the framebuffer, read input, done! A menu lets you switch games, no code upload needed.


๐Ÿ”ญ Whatโ€™s Next?

  • ๐Ÿ•น๏ธ New controllers: gamepads or keyboards
  • ๐ŸŽง Sound effects & animations in simulation
  • ๐Ÿง  More games: Pong, mini RPG, maybe multiplayer

โค๏ธ Wrapping Up

A leftover event prop became a retro pixel playground. I got to build a console, play old favorites, and experiment with rendering and threading. Thereโ€™s more to come!


๐Ÿค Want to Contribute?

Iโ€™ll open-source the project soon. If you want to:

  • Create LED games
  • Improve the simulation
  • Chat about pixel art

Letโ€™s connect!

๐Ÿง‘โ€๐Ÿ’ป Check it Out on GitHub

Updated:

Leave a comment