A classic Pacman-style game built in C using graphics.h. Navigate the maze, eat all the pellets, and avoid hitting walls! Each pellet you eat increases your score, but trying to cross a wall will deduct points. The game ends when you eat all the pellets or your score drops to zero.
- Objective: Guide Pacman through the maze to eat all the pellets while avoiding walls.
- Points: Gain points by eating pellets. Avoid crossing walls to prevent losing points.
- Turbo C or Borland C with
graphics.h
andconio.h
libraries.
-
Clone this repository:
git clone https://github.com/your-username/pacman-maze-game.git
-
Open the project in Turbo C or Borland C.
-
Ensure the
BGI
path is correctly set in theinitgraph()
function in the code:initgraph(&gd, &gm, "C:\\TURBOC3\\BGI");
-
Compile and Run the project.
Key | Action |
---|---|
⬆️ UP |
Move Up |
⬇️ DOWN |
Move Down |
⬅️ LEFT |
Move Left |
➡️ RIGHT |
Move Right |
ESC |
Exit Game |
- +10 Points for each pellet eaten.
- -5 Points for each attempt to cross a wall.
- The maze is stored as a 2D array, where
1
represents walls and0
represents open spaces. ThedrawMaze()
function reads this array and renders the walls in the game.
- Wall Collision: Prevents Pacman from crossing walls and deducts points for each attempt.
- Pellet Collision: When Pacman’s position overlaps with a pellet, it “eats” the pellet, increasing the score.
- The game ends when Pacman eats all pellets or when the score reaches zero.
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -am 'Add YourFeature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, reach out at radhikaa.godambe@gmail.com.