A re-creation of the classic Pac-Man game created using Phaser. The ghosts use improved AI to track down Pac-Man faster.
Play it here: Pac-Man
- The game map is represented as a 2D array where each cell has either a
0
or1
. - Walls are represented by
0
and1
is a traversable path. - This 2D array is passed to the
A*
function which returns an array of steps the ghosts should follow. - The function uses the
A* algorithm
to find the best path for the ghosts to take to reach Pac-Man.
Since Pac-Man's position is constantly changing, we only need to get the first step from the array of steps and move the ghost. The path that the ghosts take is highlighted by tracing the path returned by the A* function.
Use the arrow keys to control Pac-Man
Move right: 🠊 | Move left: 🠈 | Move up: 🠉 | Move down: 🠋
The game ends when a ghost catches you, refresh the page to restart.
To develop, clone the repo and start the dev server
git clone git@github.com:Aveek-Saha/Pac-Man.git
cd Pac-Man
npm start
This will automatically open http://localhost:8080/
All assets are from kenney.nl
This project was a team effort by
Name | GitHub Profile |
---|---|
Aveek Saha | aveek-saha |
Gopal Nambiar | gopuman |
Arvind Srinivasan | arvindsrinivasan |