How rahulrayy/pcg-platformer works
This is an Arcade infinite platformer launched by main.py: the player moves and jumps through a fixed opening segment into procedurally generated chunks, while the game updates physics, camera, and distance score. Chunk generation uses cellular automata and reachability checking before converting accepted tiles into sprites. The tree also contains additional validation and RL modules, but the README does not describe them and the sampled excerpts do not establish their runtime wiring, so they are not presented as part of the play workflow.
Main entry points: window.py Game window · config.py Game configuration · chunk_manager.py Chunk manager · generator.py Chunk generator
Components 15
Game runtime
- Launch entry
main.py - Game window
game/window.py - Player controls
game/player.py - Physics engine
game/physics.py - Camera
game/camera.py - Chunk manager
game/chunk_manager.py - Distance score
game/score.py
Level generation
- Opening segment
level/opening_segment.py - Chunk generator
level/generator.py - Cellular automata
level/cellular_automata.py - Chunk model
level/chunk.py - Tile sprite conversion
level/tilemap.py
Reachability validation
- BFS reachability
validation/bfs_reachability.py
Shared configuration
- Game configuration
config.py
Other components
- Player
Connections 26
- Player → Launch entry: starts game
README.md - Launch entry → Game window: creates window
main.py - Game window → Opening segment: creates opening
game/window.py - Game window → Tile sprite conversion: converts opening
game/window.py - Game window → Chunk manager: manages chunks
game/window.py - Game window → Player controls: creates player
game/window.py - Game window → Physics engine: updates physics
game/window.py - Game window → Camera: updates camera
game/window.py - Game window → Distance score: updates score
game/window.py - Chunk manager → Chunk generator: generates chunks
game/chunk_manager.py - Chunk manager → BFS reachability: checks reachability
game/chunk_manager.py - Chunk manager → Tile sprite conversion: converts chunks
game/chunk_manager.py - Chunk generator → Cellular automata: creates tile grid
level/generator.py - Chunk generator → Chunk model: builds chunk
level/generator.py - Opening segment → Chunk model: builds chunk
level/opening_segment.py - Tile sprite conversion → Chunk model: reads tiles
level/tilemap.py - BFS reachability → Chunk model: checks tiles
validation/bfs_reachability.py - Camera → Game configuration: reads settings
game/camera.py - Chunk manager → Game configuration: reads settings
game/chunk_manager.py - Physics engine → Game configuration: reads settings
game/physics.py - Player controls → Game configuration: reads settings
game/player.py - Distance score → Game configuration: reads settings
game/score.py - Opening segment → Game configuration: reads dimensions
level/opening_segment.py - Chunk generator → Game configuration: reads dimensions
level/generator.py - Cellular automata → Game configuration: reads dimensions
level/cellular_automata.py - Tile sprite conversion → Game configuration: reads tile size
level/tilemap.py