Classic Pac-Man arcade game built with HTML5 Canvas and vanilla JavaScript.
- Open
index.htmlin any modern web browser - Press SPACE to start the game
- Use Arrow Keys to move Pac-Man
- Eat all pellets to advance levels
- Avoid ghosts (unless powered up!)
- β Classic maze layout with pellets and power pellets
- β Arrow key controls with wall collision
- β
4 ghosts with different AI behaviors:
- Blinky (Red) - Chases Pac-Man directly
- Pinky (Pink) - Ambushes from ahead
- Inky (Cyan) - Random movement
- Clyde (Orange) - Chases when far, retreats when close
- β Score and lives display
- β Game states: Start screen, Playing, Death animation, Game Over, Win
- β 3 levels with increasing difficulty (speed)
- β Power mode (eat power pellets to eat ghosts)
| Key | Action |
|---|---|
| β | Move Up |
| β | Move Down |
| β | Move Left |
| β | Move Right |
| SPACE | Start / Restart |
- Pure HTML5 Canvas + Vanilla JavaScript
- No frameworks required
- Works offline
- Responsive keyboard input
MIT