File size: 621 Bytes
804cae4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ---
license: mit
title: Pac-Man (Python/pygame)
---
# Pac-Man in Python
A classic Pac-Man clone written in ~250 lines of Python using pygame.
## Run locally
```bash
pip install pygame
python pacman.py
```
## Controls
- **Arrow keys** — move
- **R** — restart after game over
- **Q** or **Esc** — quit
## Features
- Maze with dots (10 pts) and power pellets (50 pts)
- Power pellets make ghosts frightened: they turn blue, slow down, and are worth 200 pts when eaten
- 4 ghosts with simple chase AI (they pick the direction toward Pac-Man at each intersection)
- 3 lives, win screen when the maze is cleared
|