| --- |
| 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 |
|
|