Pacman Game banner

Pacman Game

1 devlog
1h 55m 21s

Pac-Man Game
A classic Pac-Man game built with vanilla JavaScript and HTML5 Canvas.
Features
Classic Gameplay: Navigate Pac-Man through a maze while collecting food and avoiding ghosts
Smooth Movement: Responsive controls with direction buffer…

Pac-Man Game
A classic Pac-Man game built with vanilla JavaScript and HTML5 Canvas.
Features
Classic Gameplay: Navigate Pac-Man through a maze while collecting food and avoiding ghosts
Smooth Movement: Responsive controls with direction buffering for seamless gameplay
Smart AI Ghosts: Four different colored ghosts with randomized movement patterns
Score System: Earn 10 points for each food pellet collected
Lives System: Start with 3 lives, lose one when caught by a ghost
Level Progression: Complete levels by eating all food pellets
Game Over & Restart: Automatic restart functionality after game over

Demo Repository

Loading README...

yousef_7abib

Shipped this project!

Hours: 1.92
Cookies: 🍪 5
Multiplier: 2.64 cookies/hr

I created a fully playable Pac-Man clone with smooth movement controls, ghosts, collision detection, and a scoring system. The game runs at 20 FPS on a 21x19 tile grid with classic gameplay mechanics.
What I learned:

Implemented direction buffering to fix choppy movement when changing directions mid-game
Fixed a tricky bug with ghosts.values() vs ghosts.values that broke ghost reset functionality
Built AABB collision detection from scratch for precise hit detection