Welcome to SPAC-MAN, a simple yet exciting game built using C++. Navigate the maze, collect points, and avoid the ghost. Can you beat the high score?
- Different Difficulty Levels: Choose between Easy, Normal, and Hard modes.
- Classic Gameplay: Move your character using arrow keys to collect points.
- Challenging AI: Avoid the ghost that chases you through the maze.
- Score Display: Keep track of your score in real-time.
- Windows OS
- C++ Compiler (e.g., GCC/CodeBlocks)
- Command Line or Terminal
- Clone the Repository:
git clone https://github.com/GR-SALMAN/spac-man.git
cd spac-man
- Compile the Game:
Open your command line or terminal in the project directory and run the following command:
g++ -o spacman main.cpp
- Run the Game:
./spacman
- After running the game, you'll see a welcome screen with instructions and difficulty options.
- H for Hard
- N for Normal
- E for Easy
- ↑ to move up
- ↓ to move down
- ← to move left
- → to move right
- Collect Points:
Move over dots (.) to collect points. Your current score is displayed in the top right corner.
Avoid the ghost (Q) that chases you. If the ghost catches you, the game ends.
When caught by the ghost, the game will display your score and end.
main.cpp: Contains the game logic and main loop. Map Rendering: Uses printf to display the game map and gotoxy to control cursor position for dynamic updates. Entity Movement: Defines an entity class for player movement and a simple AI for ghost movement using BFS (Breadth-First Search) for pathfinding.
Feel free to fork this project, submit issues, and create pull requests. Contributions are always welcome!
Suggested to use CodeBlocks in order to buid & run