How realabidhasnine/pacman_evolution works
Pac-Man Evolution is a desktop maze game built with Python’s turtle graphics. The player uses keyboard controls to navigate a wrapping maze, collect pellets and power pellets, and avoid four ghosts; the game tracks score and lives and presents win/loss restart screens. The main loop coordinates input, movement, collection, collisions, and redraws. Maze construction, actor movement and ghost decisions, and rendering are distinct supporting layers. Ghost behavior is documented more fully than the sampled actor excerpt, so those AI details are represented as documented capabilities.
Main entry points: main.py Game setup · mazes.py Maze model · actors.py Ghost movement · renderer.py Pellet renderers
Components 15
Game flow
- Game loop
main.py - Keyboard controls
main.py - Game setup
main.py - Win and restart
main.py
Maze world
- Maze layout
mazes.py - Maze model
mazes.py - Game settings
constants.py
Actors and AI
- Player
actors.py - Ghost movement
actors.py - Ghost strategies
actors.py
Rendering
- Wall renderer
renderer.py - Pellet renderers
renderer.py - Score and lives UI
renderer.py - Turtle screen
main.py
Other components
- Player
Connections 27
- Game setup → Maze layout: selects level
main.py - Game setup → Maze model: builds
main.py - Maze model → Maze layout: reads layout
mazes.py - Maze model → Game settings: uses dimensions
mazes.py - Game setup → Player: creates
main.py - Game setup → Ghost movement: creates
main.py - Game setup → Wall renderer: creates
main.py - Game setup → Pellet renderers: creates
main.py - Game setup → Score and lives UI: creates
main.py - Game setup → Turtle screen: initializes
main.py - Player → Keyboard controls: presses keys
README.md - Keyboard controls → Player: queues direction
main.py - Game loop → Player: moves
main.py - Game loop → Ghost movement: moves and checks
main.py - Ghost movement → Ghost strategies: chooses targets
actors.py - Ghost movement → Maze model: checks paths
actors.py - Player → Maze model: checks collisions
README.md - Wall renderer → Maze model: draws walls
renderer.py - Pellet renderers → Maze model: draws pellets
renderer.py - Game loop → Pellet renderers: collects stamps
main.py - Game loop → Player: updates score and speed
main.py - Game loop → Score and lives UI: writes score and lives
main.py - Game loop → Win and restart: shows win or loss
main.py - Win and restart → Game setup: restarts game
main.py - Game loop → Turtle screen: schedules redraw
main.py - Game setup → Game settings: uses dimensions
main.py - Ghost strategies → Ghost movement: defines four styles
README.md