A modern browser-based recreation of the classic Pac‑Man arcade game.
Built entirely with HTML5 Canvas, CSS, and vanilla JavaScript — no frameworks.
This project faithfully reproduces the original Pac‑Man experience while demonstrating core front‑end development and game‑programming skills:
- Smooth keyboard controls (Arrow keys / WASD)
- Intelligent Ghost AI using a shortest‑path algorithm
- Collision detection for walls, pellets, and ghosts
- Scoring and lives system displayed in real time
- Classic “waka‑waka” pellet‑chomp sound effects
The full development process, from research through testing, is documented in
PacmanProjectReport.pdf
Presentation slides: PacmanPresentation.pdf
- HTML5 Canvas Rendering – all visuals drawn directly to the canvas
- Game Loop Architecture – 30 FPS rendering and state updates handled in
game.js - Pac‑Man & Ghost Classes – modular ES6 classes (
pacman.js,ghost.js) for movement, animation, and AI - Dijkstra‑style Pathfinding – ghosts dynamically calculate the shortest route toward Pac‑Man
- Responsive Browser Play – works in Chrome, Firefox, Edge, and Safari with no build tools
Live.Demonstration.mp4
├── index.html # Main page and canvas setup
├── game.js # Game loop, map, collision logic, scoring
├── pacman.js # Pac‑Man class: movement, animation, pellet eating
├── ghost.js # Ghost class: AI pathfinding and movement
├── assets/
│ ├── animations.gif # Pac‑Man animation frames
│ ├── ghost.png # Ghost sprite sheet
│ └── sounds/
│ └── waka.mp3 # Pellet sound effect
└── docs/
├── PacmanProjectReport.pdf # Full technical report & testing
└── presentation.pdf # Slide deck
- Clone or download this repository.
- Open
index.htmlin any modern web browser. - Use Arrow keys or WASD to move Pac‑Man.
- Eat all pellets to win while avoiding ghosts.
No build step or server required.
- Front‑End Web Development – HTML5 Canvas graphics and responsive layout
- JavaScript Game Programming – real-time rendering, collision detection, state management
- Artificial Intelligence – Dijkstra-based pathfinding for adaptive enemy behaviour
- Software Engineering – modular code structure, documentation, and testing
- Complete power‑pellet mode (ghosts turn blue and flee)
- Add mobile touch controls and multiple maze layouts
- Improve audio and background music
Note: I have other major projects to pursue before returning to finish these enhancements.
Developed as an Individual Computing Project and Project Competition
to showcase strong programming, problem‑solving, and documentation skills.
Author: Pritam Gurung

