This project focuses on implementing search algorithms for ghosts in the classic Pac-Man game. The goal is to develop intelligent ghost behaviors using BFS, DFS, UCS, and A Search* and evaluate their performance.
โ Blue Ghost (BFS) - Explores all possible paths evenly.
โ Pink Ghost (DFS) - Searches deeply before backtracking.
โ Orange Ghost (UCS) - Finds the lowest-cost path.
โ Red Ghost (A*) - Uses heuristics for optimal pathfinding.
โ Parallel Execution - All ghosts move simultaneously.
โ User-Controlled Pac-Man - Players can interact in real-time.
- Python ๐
- Pygame (for visualization) ๐ฎ
- Matplotlib (for performance analysis) ๐
๐ฆ AI-Project-Search
โฃ ๐ assets
โ โฃ ๐ game_over.png # Game over screen
โ โฃ ๐ ghost_images # Ghost sprites
โ โ โฃ ๐ blue.png
โ โ โฃ ๐ dead.png
โ โ โฃ ๐ orange.png
โ โ โฃ ๐ pink.png
โ โ โฃ ๐ powerup.png
โ โ โ ๐ red.png
โ โฃ ๐ player_images # Player sprites
โ โ โฃ ๐ 1.png
โ โ โฃ ๐ 2.png
โ โ โฃ ๐ 3.png
โ โ โ ๐ 4.png
โฃ ๐ README.md # Project documentation
โฃ ๐ requirements.txt # Dependencies
โฃ ๐ src
โ โฃ ๐ main.py # Entry point
โ โฃ ๐ board.py # Game board logic
โ โฃ ๐ ghost.py # Ghost behavior
โ โฃ ๐ player.py # Player mechanics
โ โฃ ๐ search.py # Search algorithms (BFS, DFS, A*, UCS)
โ โ ๐ performance.py # Performance evaluation
โฃ ๐ Report.pdf
โ ๐ Demo.mp4
1๏ธโฃ Install dependencies:
conda install --file requirements.txt
# or
pip install -r requirements.txt2๏ธโฃ Run the main script:
python src/main.py3๏ธโฃ Control Pac-Man (if implemented):
- Arrow keys to move
๐บ Watch the demo here