A small retro-style arcade game written in Python using Flet for the UI and pygame.mixer for audio. The entire game — board generation, player, enemies, collision, sound, and 17 levels — fits in roughly 600 lines of code across five files.
The player (a triangle) moves along the edges of a randomly generated 4x4 grid of rectangles. Painting all four edges of a rectangle fills it with color. Filling corner rectangles freezes the enemies temporarily. Enemies (circles) move randomly along the same grid lines and will end the game on collision. In later levels enemies erase painted edges and move faster than the player.
- Flet 0.84 — UI, canvas drawing, keyboard input
- pygame.mixer — audio channels, stereo panning, music loop
- Pure Python — no game engine, no external rendering library
src/
main.py # game loop, level definitions, UI (17 levels)
board.py # graph generation, edge/rect logic, canvas rendering
player.py # player movement, direction buffering, pulse and rotation animation
sprites.py # enemy movement, random graph traversal
audio.py # music, sfx, walk loop, stereo pan
assets/ # mp3 files
board.py generates a graph of nodes and edges from randomized column heights.
Rectangles are defined by their four boundary edges (which may be subdivided by intermediate nodes).
Painting is just adding a frozenset of two node IDs to a set — completion check is a single issubset call.
17 levels defined as a simple list of tuples:
(num_sprites, speed_factor, erase, full_edge_required)From level 15 onward enemies move 15% faster than the player.
# Clone and enter the repository
git clone https://github.com/dein-name/arcade.git
cd arcade
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install flet pygame
# Run the game
flet run src/main.pyCode: CC BY-NC 4.0 — Volker Heggemann Background music and sound effects: see BACKGROUND_LICENSE.txt and MUSIC_LICENSE.txt
