A Python-based AI-powered Pac-Man game built as part of our semester project. This implementation includes intelligent ghost behavior (scatter, chase, return), a reactive AI using a greedy strategy, and a visually engaging interface to showcase classic gameplay with modern AI features.
Pac-Man is a classic arcade game where the player navigates a maze, collecting pellets and avoiding ghosts. In this project, we bring Pac-Man to life using Python with advanced AI behavior for the ghost enemies. The ghosts act based on different strategies such as chasing the player, scattering to corners, returning after being eaten, and adapting to player actions through a reactive greedy approach.
File/Folder | Description |
---|---|
pacman.py |
Main game logic and loop |
images/ |
Game assets (images, sounds) |
board.py |
Maze layout in text format |
report.pdf |
Project report |
proposal.pdf |
Original project proposal |
README.md |
This documentation file |
python pacman.py
Click the link below to view a live demo of the game in action: View Project DEMO
Download the final report here:View Project Report
View our original proposal here:View Project Proposal
Our ghost AI is inspired by the behavior patterns in the original Pac-Man game, enhanced with modern techniques:
Scatter Mode: Each ghost retreats when powerups are enabled.
Chase Mode: Ghosts track Pac-Man using a greedy pathfinding strategy.
Return Mode: Ghosts return to the ghost house after being eaten.
Reactive AI: Ghosts change behavior based on Pac-Man's current direction, location and enviroment.
Greedy Approach: Ghosts make immediate best choices rather than planning ahead.
Different Ghost Behaviors: Each ghost may follow different strategies β one chases directly, another predicts movement, and one may block paths.
This project demonstrates how traditional game mechanics can be enhanced using AI techniques. We combined search-based strategies and state-driven behavior models to simulate intelligent and reactive enemy agents. The final result is a fun, challenging, and technically enriched recreation of Pac-Man.