Skip to content

luffy-2606/Pacman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pac-Man Animation

line break

C++ solutions Arcade Game SFML 2.5.1 Version 1.6

📖 About

A modern C++ implementation of the classic Pac-Man arcade game. Navigate through the maze, collect dots, avoid ghosts, and use power-ups to turn the tables on your pursuers!

🎯 Features

  • 👾 Classic Pac-Man gameplay mechanics
  • 👻 Multiple ghosts with AI behavior
  • 🍒 Dots and energizers collection
  • 🧱 Wall collision detection and tunnel warping
  • 📊 Score tracking and multiple lives
  • 🔄 Game over screen with replay option

🎮 Controls

Key Action
I Move Up
K Move Down
J Move Left
L Move Right
ESC Pause/Unpause
ENTER Restart (after Game Over)
ESC Exit (after Game Over)

🏗️ Project Structure

├── main.cpp            # Application entry point
├── Game.h/cpp          # Core game loop and coordination
├── GameObject.h/cpp    # Base class for all game objects
├── Pacman.h/cpp        # Player character implementation
├── Ghost.h/cpp         # Enemy implementation
├── GhostStrategy.h/cpp # Ghost AI behavior strategies
├── Maze.h/cpp          # Game map and collision detection
├── Dot.h/cpp           # Collectible implementation
└── Energizer.h/cpp     # Power-up implementation

🖥️ Implementation Details

  • Pacman: Handles user input, power-up states, and character animation
  • Ghosts: Implements AI movement and state transitions between normal and frightened modes
  • Maze: Manages game map layout, walls, tunnels, and item placement
  • Game: Orchestrates object interactions, collisions, and game state

🛠️ Customization

The game can be easily customized:

  • Modify the number of ghosts by updating ghost-count values in Game.h, Maze.h and the map in Maze.cpp
  • Adjust game difficulty by tweaking ghost speeds and AI behavior
  • Change maze layouts for different levels
  • Pacman colour can also be altered in pacman.cpp

📸 Screenshots

🧩 Dependencies

  • C++ compiler (built on Visual Studio Code 2022 & Cursor)
  • SFML 2.5.1 - Click for setup guide

📜 License

This project is released under the MIT License.

About

Project for my second semester OOP Course. Once again I got 100/100 :)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages