
ESP32 TFT 2D Game Display: Running a Game on Microcontroller Hardware
Some thoughts on building a 2D game on an ESP32 and a TFT display — frame timing, partial redraws, input lag, and why a tiny game is a great embedded exercise.
Why a game on an ESP32?
A game looks like a fun toy. It is, but it is also a sneakily good way to learn embedded systems properly. You can not cheat — timing, memory, input, graphics refresh, state, all of it has to behave.
I built this one to push myself on those exact things. The whole game runs on the ESP32. There is no PC streaming pixels to a screen. The microcontroller draws every frame.
Display + game loop
The TFT is wired up over SPI. The firmware runs a steady game loop: read input, update state, redraw the parts that changed, check collisions, decide if the game is over.
On a desktop you can be lazy. On a microcontroller, every frame is something you have to budget for.
Things that quietly kill a microcontroller game
- Redrawing the whole screen every frame. The game gets flickery and slow.
- Blocking input reads with display writes. The game stops feeling responsive.
- Using too much RAM for sprites. The ESP32 will let you know.
So the design is intentionally minimal: simple geometry, partial redraws, and clear separation between drawing and input.
What this project taught me
A game is a really honest teacher. It forces discipline. Bad timing becomes visible immediately. Sloppy state management ruins the feel. Small delays are felt by the player, not just measured on a logic analyzer.
Next steps
Sound, a high-score saved in EEPROM, a difficulty selector, a menu screen, and a custom PCB so the whole thing can live in a handheld enclosure. Even as it stands, the project is a small but solid demo of what an ESP32 can do when you ask it to do real-time work.