gopuman / Pac-Man

๐Ÿ•น A recreation of the classic Pac-Man game with better AI for the ghosts.

Home Page:https://home.aveek.io/Pac-Man/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pac-Man

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

Ghost AI

  • The game map is represented as a 2D array where each cell has either a 0 or 1.
  • Walls are represented by 0 and 1 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.

Controlling Pac-Man

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.

Gameplay

Development

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/

Assets

All assets are from kenney.nl

Team

This project was a team effort by

Name GitHub Profile
Aveek Saha aveek-saha
Gopal Nambiar gopuman
Arvind Srinivasan arvindsrinivasan

About

๐Ÿ•น A recreation of the classic Pac-Man game with better AI for the ghosts.

https://home.aveek.io/Pac-Man/

License:MIT License


Languages

Language:JavaScript 97.4%Language:HTML 2.6%