How shayanshahrabi/pac-man works
Main Components
• Game Engine/Main Controller – Represented by the pacman.cpp source code that implements all game logic including user input processing, game-loop control, and handling game state.
• Maze Generation Module – A clearly identifiable component since the README explains that the maze is generated using the DFS algorithm. This can be a module/function focused on creating the game’s maze based on user-specified dimensions.
• Ghost AI / Pathfinding Module – The README describes using BFS for ghost movement. Illustrate this as a separate logical component (or submodule) within the game engine that controls the behavior of the ghosts (like Blinky and the others with varied targeting strategies).
• Data Persistence Component – This portion handles file operations. Three files (scoreBoard.txt, maze.txt, and creature.txt) are used to store the leader board and checkpoint data. A module should be depicted that checks, reads, writes, and creates these files as needed.
• External Dependencies – Note the use of Windows-specific libraries and support for terminal environments that correctly display Unicode characters.
Architectural Patterns & Principles
• Even though it’s a relatively simple project, note the modular design: separate concerns for game logic, maze generation, AI, rendering, and persistence.
• Mention that the overall design is essentially a tightly-coupled, monolithic application with distinct responsibilities, which is common in smaller, educational projects.
Commentary on Technologies and Tools
• Technology: C++ is the primary language, and it leverages system-specific libraries (windows.h).
• Frameworks: No external frameworks are used; instead, console output and file I/O are handled directly within C++.
• Data Storage: Use of text files to persist game state and leader board data, which implies simple file system integration without databases.