How yazeedbarakat/pacman works
Pac-Man is a Pygame arcade game: the player enters through the game’s menu and controls Pac-Man through generated maze levels, collecting pellets and avoiding ghosts; the run ends in a saved high-score entry or progression to the next level. The architecture separates orchestration, maze and entity behavior, screens/rendering, and score persistence. README capabilities include configuration, ghost AI, cheat controls, and high-score rankings. Some game.py wiring is inferred only where its excerpt documents the behavior; uncertain implementation links are omitted.
Main entry points: game.py Game Loop · maze_pacgum.py Maze And Pellets · pacman_setup.py Pac-Man Entity · ghost_renderer.py Ghost Renderer
Components 14
Game Flow
- Game Loop
game.py
Maze And Entities
- Maze And Pellets
maze_pacgum.py - Pac-Man Entity
pacman_setup.py - Ghost AI
ghost.py
Screens And Rendering
- Ghost Renderer
ghost_renderer.py - Screens And HUD
displays.py - Game Sprites
assets
Configuration And Scores
- Config Parser
config_parser.py - Game Config
config.json - High Scores
high_scores_config.py - Score JSON
pc.json
Other components
- Player
- Pygame
- MazeGenerator
Connections 22
- Player → Game Loop: provides input
- Game Loop → Pygame: dispatches events
- Game Loop → Config Parser: loads settings
- Game Config → Config Parser: read by
- Game Loop → Maze And Pellets: builds levels
- Maze And Pellets → MazeGenerator: generates maze
- Game Loop → Pac-Man Entity: creates and updates
- Game Loop → Ghost AI: updates and checks
- Pac-Man Entity → Maze And Pellets: moves on grid
- Ghost AI → Maze And Pellets: validates moves
- Game Loop → Screens And HUD: draws screens
- Game Loop → Ghost Renderer: draws ghosts
- Ghost Renderer → Ghost AI: renders state
- Game Loop → High Scores: records run
- Screens And HUD → High Scores: loads rankings
- High Scores → Score JSON: reads and writes
- Screens And HUD → Pygame: draws UI
- Maze And Pellets → Pygame: draws maze
- Pac-Man Entity → Pygame: draws player
- Ghost Renderer → Pygame: draws sprites
- Ghost Renderer → Game Sprites: loads sprites
- Pac-Man Entity → Game Sprites: loads frames