https://github.com/dhuvie/pac-man
Modern C++ implementation of Pac-Man with advanced AI pathfinding (Dijkstra, A*), OpenGL graphics, particle effects, and bulletproof collision detection. Features 4 unique ghost personalities with sophisticated behavioral algorithms.
https://github.com/dhuvie/pac-man
arcade-game cmake cpp djkstra game-development opengl pacman pathfinding
Last synced: 2 months ago
JSON representation
Modern C++ implementation of Pac-Man with advanced AI pathfinding (Dijkstra, A*), OpenGL graphics, particle effects, and bulletproof collision detection. Features 4 unique ghost personalities with sophisticated behavioral algorithms.
- Host: GitHub
- URL: https://github.com/dhuvie/pac-man
- Owner: Dhuvie
- License: mit
- Created: 2025-10-18T01:18:16.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-18T23:00:21.000Z (9 months ago)
- Last Synced: 2025-10-19T13:31:18.547Z (9 months ago)
- Topics: arcade-game, cmake, cpp, djkstra, game-development, opengl, pacman, pathfinding
- Language: C++
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ก PAC-MAN
> **A modern, high-performance C++ implementation of the classic Pac-Man arcade game with advanced AI and stunning OpenGL graphics.**





---
## Features
### **Classic Gameplay**
- **Authentic Pac-Man Experience** - Navigate mazes, collect dots, avoid ghosts
- **Perfect Collision Detection** - Bulletproof wall collision system
- **Smart Movement Controls** - Intelligent direction changes prevent getting stuck
- **Power Pellets** - Turn the tables and chase the ghosts!
### **Advanced Ghost AI**
- **4 Unique Ghost Personalities**:
- **Blinky (Red)** - Aggressive direct pursuit
- **Pinky (Pink)** - Strategic ambush tactics
- **Inky (Cyan)** - Complex patrol patterns
- **Clyde (Orange)** - Unpredictable behavior
- **Multiple Pathfinding Algorithms** - Dijkstra, A*, and Backtracking
- **Dynamic AI** - Ghosts adapt to your playstyle
### **Visual Excellence**
- **OpenGL-Powered Graphics** - Hardware-accelerated rendering
- **Particle Effects** - Beautiful visual feedback for game events
- **Smooth 60 FPS Gameplay** - Fluid character animations
- **Classic Aesthetic** - Faithful to the original Pac-Man design
### **Game Features**
- **Progressive Difficulty** - Increasingly challenging levels
- **Multiple Lives System** - Visual life indicators
- **Power-Up Mechanics** - Temporary ghost vulnerability
- **Level Progression** - Complete mazes to advance
---
## Quick Start
### Prerequisites
- **C++17** compatible compiler (MSVC, GCC, Clang)
- **CMake 3.10+**
- **OpenGL 3.3+**
- **GLFW3** and **GLEW** libraries
### Build Instructions
#### Windows
```cmd
# Clone the repository
git clone https://github.com/Dhuvie/Pac-man.git
cd Pac-man
# Build using the provided script
build.bat
# Or build manually
mkdir build && cd build
cmake ..
cmake --build . --config Release
# Run the game
cd Release
Pacman.exe
```
#### Linux/Mac
```bash
# Clone the repository
git clone https://github.com/Dhuvie/Pac-man.git
cd Pac-man
# Build the project
mkdir build && cd build
cmake ..
make
# Run the game
./Pacman
```
---
## Controls
| Action | Keys |
|--------|------|
| **Move** | `Arrow Keys` or `WASD` |
| **Start Game** | `Enter` |
| **Pause** | `P` |
| **Exit** | `Escape` |
---
## Project Structure
### Prerequisites
- **C++17** compatible compiler (MSVC, GCC, Clang)
- **CMake 3.10+**
- **OpenGL 3.3+**
- **GLFW3** and **GLAD** libraries
### Build & Run
```bash
# Clone the repository
git clone https://github.com/Dhuvie/Pac-man.git
cd Pac-man
# Build the project
mkdir build && cd build
cmake ..
cmake --build . --config Release
# Run the game
./Release/Pacman.exe # Windows
./Pacman # Linux/Mac
```
### Windows Quick Build
```cmd
# Use the included batch file
build.bat
```
## Architecture
```
Pac-Man Game
โโโ Game.cpp/h # Main game loop & state management
โโโ Player.cpp/h # Pac-Man character & controls
โโโ Ghost.cpp/h # AI behaviors & pathfinding
โโโ Maze.cpp/h # Level layout & collision detection
โโโ Renderer.cpp/h # OpenGL rendering & effects
โโโ ParticleSystem.cpp/h # Visual effects system
โโโ ResourceManager.cpp/h # Asset management
โโโ Shader.cpp/h # OpenGL shader handling
โโโ shaders/ # GLSL shader files
```
## Technical Highlights
- **Modern C++17**: Clean, object-oriented design
- **High Performance**: Optimized rendering and game logic
- **Bulletproof Collision**: Perfect wall detection system
- **Advanced AI**: Multiple pathfinding algorithms
- **Visual Effects**: Particle systems and smooth animations
- **Resource Management**: Efficient asset handling
- **Cross-Platform**: CMake build system
---
## Contributing
Contributions are **welcome**! Here's how you can help:
1. **Fork** the repository
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
4. **Push** to the branch (`git push origin feature/amazing-feature`)
5. **Open** a Pull Request
### Bug Reports
- Use the **Issues** tab to report bugs
- Include **steps to reproduce** and **system information**
### Feature Requests
- Suggest new features via **Issues**
- Describe the **use case** and **expected behavior**
---
## License
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
---
## Acknowledgments
- **Namco** - Original Pac-Man creators (1980)
- **OpenGL Community** - Graphics libraries and documentation
- **C++ Community** - Modern C++ best practices
- **Game Development Community** - Inspiration and techniques
---
## Project Stats
- **Language**: C++17
- **Graphics**: OpenGL 3.3+
- **Build System**: CMake
- **Lines of Code**: ~3000+
- **Development Time**: Intensive optimization and polish
---
**โญ Star this repository if you enjoyed the game! โญ**
[Report Bug](https://github.com/Dhuvie/Pac-man/issues) ยท [Request Feature](https://github.com/Dhuvie/Pac-man/issues)