Skip to content

The Classic PACMAN game, an exciting venture that combines the classic gameplay of PACMAN with modern programming techniques. Our PACMAN project is a faithful recreation of the classic arcade game.

License

Notifications You must be signed in to change notification settings

thirumuruganra/PACMAN-using-C-and-RAYLIB

Repository files navigation

PACMAN Game using C and RAYLIB

Table of Contents

Introduction

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.

Features

  • Classic Pac-Man gameplay
  • Simple, intuitive controls
  • Retro-style graphics
  • Sound effects
  • Score tracking

Installation

Prerequisites

  • C Compiler (e.g., GCC)
  • Raylib library installed

Installing Raylib

If you don't have Raylib installed, follow the instructions on the Raylib installation page.

Building the Game

  1. Clone the repository:

    git clone https://github.com/thirumuruganra/PACMAN-using-C-and-RAYLIB.git
    cd pacman-raylib
  2. Compile the game:

    gcc -o pacman PACMAN_Final.c -lraylib -lm -lpthread -ldl -lrt
  3. Run the game:

    ./pacman

Usage

After building the game, run the executable to start playing. Use the controls listed below to navigate Pac-Man through the maze.

Controls

  • 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

Game Design

Maze

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.

Score

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.

Lives

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.

Levels

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.

Replay

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

Contributors

Credits

  • 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

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

The Classic PACMAN game, an exciting venture that combines the classic gameplay of PACMAN with modern programming techniques. Our PACMAN project is a faithful recreation of the classic arcade game.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published