Welcome to the Pac-Man game, developed using C and the Raylib library. This project is a simple recreation of the classic arcade game Pac-Man. The goal is to navigate Pac-Man through a maze, eating all the dots while avoiding ghosts.
- Classic Pac-Man gameplay
- Simple, intuitive controls
- Retro-style graphics
- Sound effects
- Score tracking
- C Compiler (e.g., GCC)
- Raylib library installed
If you don't have Raylib installed, follow the instructions on the Raylib installation page.
-
Clone the repository:
git clone https://github.com/thirumuruganra/PACMAN-using-C-and-RAYLIB.git cd pacman-raylib
-
Compile the game:
gcc -o pacman PACMAN_Final.c -lraylib -lm -lpthread -ldl -lrt
-
Run the game:
./pacman
After building the game, run the executable to start playing. Use the controls listed below to navigate Pac-Man through the maze.
- Arrow Keys: Move Pac-Man
- Y: To Replay the Game After Winning or Losing
- N: Quit the game After Winning or Losing
- Esc: Quit the game while playing
The maze consists of walls, pellets, power pellets, and ghosts. The objective is to eat all the pellets and super pellets while avoiding the ghosts. Eating a power pellet allows Pac-Man to eat the ghosts for a short duration (that is 9 seconds). If you eat all the pellets while avoiding the ghosts, then you WIN the game.
Points are awarded for eating pellets, super pellets and ghosts. The game tracks your score, which is displayed at the bottom of the screen. The high score is also displayed at the bottom of the screen.
The player has 3 lives, and when the PACMAN comes in contact with a ghost, the number of lives decreases. When the player scores 5000 points, 1 extra life is awarded. If you lose all your lives, then the game ends.
The game includes EASY, MEDIUM and HARD levels with increasing difficulty. Each level increases the speed of the ghosts, thereby making the game more challenging and complex.
If the player wins or loses the game, then they are given the option to replay the game by choosing Y or close the window by pressing N
- Thirumurugan RA - thirumuruganra
- Vishal Muralidharan - vizz1006
- Varun Prakash - hauseboi
- Raylib: An easy-to-use library to enjoy videogames programming by Ray San
- Original Pac-Man Game: Created by Toru Iwatani and published by Namco
This project is licensed under the MIT License - see the LICENSE file for details.