How loragegronde/pac-man works
This is a pygame Pac-Man game: the player starts from a menu, enters a ten-level campaign, and reaches victory or game over, where a name can be submitted to persistent highscores. The runtime also supports instructions, pause, and gameplay cheats. The graph preserves the documented gameplay stages and major UI branches. Some scene and campaign connections are documented in the README or named in the source index; unsampled implementation details are not inferred beyond those references.
Main entry points: graphics.py Window and routing · game.py Level simulation · level_handler.py Level progression · highscores.py Highscores
Components 25
Scenes and UI
- Window and routing
src/graphics.py - Main menu
src/menu.py - Instructions
src/instructions.py - Pause overlay
src/pause.py - Cheat menu
src/cheat_menu.py - Victory screen
src/victory.py - Game-over screen
src/game_over.py - Name entry
src/name_box.py - Highscores
src/highscores.py
Campaign flow
- Level progression
src/visual/level_handler.py - Game HUD
src/visual/hud.py
Level simulation
- Level simulation
src/visual/game.py - Maze generation
src/visual/maze.py - Pac-Man movement
src/visual/player.py - Ghost handling
src/visual/enemy_handler.py - Ghost behavior
src/visual/enemy.py - BFS pathfinding
src/visual/pathfinding.py - Cheat state
src/cheats.py
Configuration and assets
- Game entry
pac-man.py - Config parsing
src/parsing.py - Sprites and fonts
src/assets.py
Other components
- Player
- Game config
config.json - Highscore JSON
- Maze generator library
Connections 32
- Player → Window and routing: provides input
README.md - Game entry → Config parsing: parses settings
README.md - Game config → Config parsing: loads JSON
src/parsing.py - Game entry → Window and routing: starts game
README.md - Window and routing → Level progression: routes gameplay
src/graphics.py - Window and routing → Main menu: routes scenes
README.md - Window and routing → Instructions: routes scenes
README.md - Window and routing → Pause overlay: routes scenes
README.md - Window and routing → Cheat menu: routes scenes
README.md - Window and routing → Victory screen: routes scenes
src/graphics.py - Window and routing → Game-over screen: routes scenes
src/graphics.py - Window and routing → Name entry: handles entry
src/graphics.py - Window and routing → Highscores: updates scores
src/graphics.py - Main menu → Highscores: shows scores
src/menu.py - Highscores → Highscore JSON: reads and writes
README.md - Name entry → Highscores: submits name
src/graphics.py - Level progression → Level simulation: creates levels
src/visual/level_handler.py - Level progression → Game HUD: updates display
src/visual/level_handler.py - Level simulation → Maze generation: creates maze
src/visual/game.py - Level simulation → Pac-Man movement: moves player
src/visual/game.py - Level simulation → Ghost handling: updates ghosts
src/visual/game.py - Ghost handling → Ghost behavior: updates ghosts
src/visual/enemy_handler.py - Ghost behavior → BFS pathfinding: finds routes
src/visual/enemy.py - Ghost behavior → Maze generation: reads grid
src/visual/enemy.py - Ghost handling → Maze generation: uses maze
src/visual/enemy_handler.py - Level simulation → Cheat state: checks flags
src/visual/game.py - Level progression → Cheat state: checks flags
src/visual/level_handler.py - Cheat menu → Cheat state: edits settings
src/cheat_menu.py - Cheat menu → Level progression: edits campaign
src/cheat_menu.py - Level simulation → Sprites and fonts: loads sprites
src/visual/game.py - Level progression → Sprites and fonts: uses assets
src/visual/level_handler.py - Maze generation → Maze generator library: generates grid
src/visual/maze.py