Skip to content

About

Classic Pacman Game built with JavaScript and HTML5 – Eat all the pellets while avoiding ghosts in this browser-based arcade game. Features smooth sprite-based animations, AI-controlled ghosts with pathfinding, a scoring system, multiple lives, and a start/game-over interface. Fully playable with keyboard controls

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🟡 Pacman Game

HTML5 Canvas CSS3 JavaScript Made with Love Pacman License: MIT

A classic Pacman clone built with vanilla JavaScript, HTML5 Canvas, and CSS.
This project recreates the nostalgic arcade experience, featuring AI-controlled ghosts, scoring, lives system, and collision mechanics.



🎮 Features

  • Classic Gameplay – Eat all the food pellets while avoiding ghosts.

  • Ghost AI – Ghosts use pathfinding (BFS) and random targeting for chasing Pacman.

  • Lives System – Pacman starts with 3 lives.

  • Scoring – Collect pellets to increase your score.

  • Start & Game Over Screens – With blinking start text and restart prompt.

  • Smooth Animations – Sprite-based animations for Pacman and ghosts.

  • Keyboard Controls – Arrow keys / WASD to move, Space to start or restart.



🕹️ Controls

Key / Mouse Action
⬅️ / A Move Left
➡️ / D Move Right
⬆️ / W Move Up
⬇️ / S Move Down
space Start / Restart


🎬Demo

Game Demo

Check out the live Game here 👉 Play Pacman Game



📂 Project Structure

pacman-game/
│── index.html       # Entry point (canvas + assets loader)
│── game.js          # Main game loop, rendering, score & lives
│── pacman.js        # Pacman class (movement, collision, animation)
│── ghost.js         # Ghost class (AI pathfinding + chasing logic)
│── assets/          # Sprites & images 
     │── animations.gif
     │── ghost.png
     │── startImage.png


⚡ Getting Started

# Clone the repository:
git clone https://github.com/your-username/pacman-game.git

# Open index.html in your browser.

Enjoy the game! 🎉



🛠️ Tech Stack

  • JavaScript (ES6) – Core logic & game mechanics
  • HTML5 Canvas – Rendering graphics
  • CSS – Styling & layout
  • Sprite Sheets – Pacman & Ghost animations


⭐ Feel free to contribute, fork, or open issues to improve this project.

About

Classic Pacman Game built with JavaScript and HTML5 – Eat all the pellets while avoiding ghosts in this browser-based arcade game. Features smooth sprite-based animations, AI-controlled ghosts with pathfinding, a scoring system, multiple lives, and a start/game-over interface. Fully playable with keyboard controls

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages