Temple Run–style 2.5D endless runner implemented on the UIUC ECE 385 FPGA platform.
A MicroBlaze soft processor runs the game logic, a custom renderer IP draws each frame into DDR3 as a framebuffer, and a custom HDMI controller IP streams frames out to an HDMI display.
School Run is a hallway-themed endless runner:
- The player runs down a perspective school hallway.
- Coins and grade items appear in three lanes.
- Obstacles spawn and must be avoided.
- Hearts indicate remaining lives, and the final grade depends on performance.
All visual assets (characters, coins, obstacles, UI, backgrounds) are preprocessed into RGB565 arrays and stored in memory as assets.
On each frame, the game loop:
- Reads player input (move lanes, jump, restart).
- Updates player position, jump state, coins, obstacles, hearts, and score.
- Translates world positions into screen-space using a simple perspective mapping.
- Fills sprite/asset slots in the renderer (player, coins, obstacles, UI, etc.).
- Triggers the renderer to draw the frame into the off-screen framebuffer.
- Swaps framebuffers so the HDMI controller reads the newly rendered frame.
- Left / Right: Arrow keys
- Jump:
Space - Restart:
R - Start / Continue:
S
-
MicroBlaze
- Runs the main game loop (C code).
- Writes all sprite/asset parameters and control registers for the renderer and HDMI controller.
- Manages double-buffered framebuffers in DDR3.
-
Renderer IP
- AXI4-Lite slave interface.
- Implements a scanline renderer with:
- Local BRAM color buffer and depth (Z) buffer per scanline.
- Depth-based compositing for in-game sprites (walls, floor, coins, obstacles, player).
- Painter’s algorithm-style ordering for UI elements (hearts, score, grade).
- Writes completed scanlines into the active DDR3 framebuffer.
-
HDMI Text/Framebuffer Controller IP
- AXI4-Full read master from DDR3.
- Uses a small ping-pong BRAM line buffer while streaming pixels to the HDMI TX core.
- Generates the video timing and sends TMDS signals through the HDMI TX IP.
-
SchoolRun_hw/
Vivado project (block design, top-level HDL, constraints, etc.). -
SchoolRun_hw/ip_repo/
Custom IP repository:renderer_1_0/– renderer IP.hdmi_text_controller_2_0/– HDMI text/framebuffer controller IP.hdmi_tx_1.0/– HDMI TX core and helpers.
-
SchoolRun_firmware
MicroBlaze C sources:game.c,game.h– core game state and update logic.renderer.c,renderer.h– high-level API for the renderer IP.audio.c,audio.h– simple PWM audio engine.lw_usb_main.candlw_usb/– USB input stack.sprites/*.h– all image assets (sprites, UI, backgrounds) as RGB565 arrays.
-
assets/Contains original graphic source files (PNG format) and generated RGB arrays (raw data) used for sprite rendering. Organized by category (backgrounds, characters, UI, etc.)..