Skip to content

Classic Pac-Man recreated in Python/Pygame, showcasing sophisticated state-based ghost AI and dynamic scaling for responsive gameplay.

Notifications You must be signed in to change notification settings

Talha-Munir-Saeed3/PACMAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🟑 Pac-Man AI Project

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.


πŸ“‹ Table of Contents


πŸ“– Introduction

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.


πŸ“ Project Files

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

▢️ How to Run

python pacman.py

πŸŽ₯ Demo

Click the link below to view a live demo of the game in action: View Project DEMO


πŸ“‘ Report

Download the final report here:View Project Report


πŸ“ Project Proposal

View our original proposal here:View Project Proposal


🧠 AI Features

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.


🏁 Conclusion

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.

Releases

No releases published

Packages

No packages published

Languages