๐ฎ 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.)
๐ฅ 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
Leave a comment