Code Monkey home page Code Monkey logo

pac-man's Introduction

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 [email protected]: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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.