How fxaxbxc/pac-man works
This repository is a terminal Pac-Man game implemented in one C++ source file. The player selects a menu option, navigates the maze while collecting dots and avoiding ghosts, then sees a win/loss result; completed scores can be saved and viewed or searched in the leaderboard. The graph separates gameplay, presentation, and score features even though they share main.cpp. The excerpt omits some function bodies and dispatch code, so only documented or excerpt-visible relationships are shown.
Main entry points: main.cpp Game Loop
Components 18
Gameplay
- Game Entry
main.cpp - Maze State
main.cpp - Player Movement
main.cpp - Ghost Movement
main.cpp - Collision & Lives
main.cpp - Game Loop
main.cpp
Terminal Interface
- Main Menu
main.cpp - Game Display
main.cpp - Game Result
main.cpp - Instructions View
main.cpp
Scores
- Load Scores
main.cpp - Save Score
main.cpp - Sort Scores
main.cpp - Leaderboard View
main.cpp - Player Search
main.cpp
Other components
- Player
- Ncurses Terminal
- Score File
Connections 23
- Player → Main Menu: selects
README.md - Main Menu → Game Loop: starts game
README.md - Game Loop → Maze State: uses state
main.cpp - Game Loop → Game Display: draws
main.cpp - Game Loop → Ghost Movement: updates
main.cpp - Game Loop → Game Result: shows result
README.md - Player → Player Movement: controls
README.md - Player Movement → Maze State: checks walls
main.cpp - Ghost Movement → Maze State: checks walls
main.cpp - Ghost Movement → Collision & Lives: risks collision
main.cpp - Game Loop → Save Score: saves finished score
main.cpp - Save Score → Score File: writes
README.md - Load Scores → Score File: reads
README.md - Leaderboard View → Load Scores: loads scores
README.md - Leaderboard View → Sort Scores: orders scores
README.md - Player Search → Load Scores: loads scores
main.cpp - Player Search → Score File: searches loaded data
- Main Menu → Leaderboard View: opens
README.md - Main Menu → Player Search: opens
README.md - Main Menu → Instructions View: opens
README.md - Game Display → Ncurses Terminal: renders through
main.cpp - Main Menu → Ncurses Terminal: renders through
README.md - Game Result → Ncurses Terminal: renders through
README.md