How dij0/qix_game works
PyGame Xonix is a real-time territory-capture game. The player leaves the safe border to draw a trail; when the trail reconnects, the game captures territory, awards progress, and advances levels with changing difficulty and up to three lives. Game.py coordinates input, updates, collisions, menus, and level state. Polygon.py handles the territory mask and fill algorithm, while the inverse mask supports ghost-ball movement. Relationships below are grounded in the sampled source and README; the game loop is the central coordinator.
Main entry points: Game.py Game coordinator · Polygon.py Territory capture · Ball.py Moving balls · Player.py Player trail
Components 8
Game loop
- Game coordinator
Game.py
Playfield entities
- Player trail
Player.py - Territory capture
Polygon.py - Inverse mask
InversePolygon.py - Moving balls
Ball.py
Controls and menu
- Menu
Button.py - Menu buttons
Button.py
Other components
- Player
Connections 11
- Player → Game coordinator: plays
README.md - Game coordinator → Player trail: handles input
Game.py - Game coordinator → Player trail: updates
Game.py - Game coordinator → Territory capture: tracks progress
Game.py - Game coordinator → Moving balls: updates
Game.py - Game coordinator → Menu: handles clicks
Game.py - Player trail → Territory capture: draws capture
Player.py - Moving balls → Territory capture: checks collisions
Ball.py - Moving balls → Inverse mask: checks ghost collisions
Ball.py - Territory capture → Inverse mask: updates mask
Polygon.py - Menu → Menu buttons: shows and dispatches
Button.py