A retro-style Pac-Man clone built with Python. Navigate mazes, collect pellets, avoid ghosts, and chase high scores — all from your terminal or browser.
Features:
- 🎮 Classic arcade gameplay
- 🖥️ Terminal-based (Python/curses) and web versions
- 🗺️ Custom level support with simple text-based maps
- 👻 Ghost AI with vulnerable states via power pellets
- 🏆 High score tracking
Create .txt files in the levels/ directory. Level files must be rectangular (all rows same width).
C- Cman spawn point (required, only one)M- Ghost spawn points (optional, multiple allowed).- Pellets (dots to collect)o- Power pellets (makes ghosts vulnerable)─│┌┐└┘├┤┬┴┼- Walls (Unicode box drawing)- Empty space (walkable)
- Ghost spawn areas should have openings for ghosts to exit
- Horizontal warping supported - gaps in left/right walls allow wrapping
- Vertical warping not supported
┌───────────┐
│. . . . . o│
│.┌───┐.┌─┐.│
│.└───┘.└─┘.│
│. . . . . .│
└─┐.┌─ ─┐.┌─┘
│.│M M│.│
┌─┘.└───┘.└─┐
│. . .C. . .│
│.┌───┐.┌─┐.│
│.└───┘.└─┘.│
│o . . . . .│
└───────────┘- Arrow keys or WASD - Move
- P - Pause
- Q - Quit
docker run --rm -it rjchicago/cmanpython3 cman.py- Interactive level selectionLEVEL=003 python3 cman.py- Load specific level
docker compose build- Build with Dockerdocker compose run --rm --it cman- Run interactivelydocker compose run --rm --it -e LEVEL=003 cman- Load specific level
Create a shell alias for easier usage:
cman () {
docker run --rm -it -e LEVEL="$LEVEL" rjchicago/cman "$@"
}# Usage
cman
# Load a specific level
LEVEL=003 cman