pi-pac-man
v0.1.0
Published
Pac-Man extension for Pi
Maintainers
Readme
pi-pac-man
Play a terminal-native Pac-Man game inside Pi.
pi-pac-man adds a persistent TUI overlay opened with /pac-man. You move Pac-Man through multi-level ASCII mazes while four local ghosts chase, scatter, and flee deterministically.
Features
- Centered terminal overlay, built with Pi TUI
- Three larger levels
- Four named ghosts: Blinky, Pinky, Inky, and Clyde
- Pellets, power pellets, frightened ghosts, lives, scoring, and level clears
- Arrow-key and WASD input
- Session persistence across Pi reloads/resumes
- Validated saved state, wall collision checks, and deterministic rules
- TypeScript source, no build step required
- Manual npm publish workflow included
Install
pi install npm:pi-pac-manOr add it to ~/.pi/agent/settings.json:
{
"packages": ["npm:pi-pac-man"]
}Usage
Start or resume a game:
/pac-manStart a fresh game:
/pac-man newControls
| Key | Action |
| --- | --- |
| Arrow keys | Move Pac-Man |
| W A S D | Move Pac-Man |
| n | New game |
| q | Close overlay |
The overlay is TUI-only. It will not open in Pi print, JSON, or RPC modes.
Symbols
| Symbol | Meaning |
| --- | --- |
| Green P | Pac-Man |
| Red B K I C | Dangerous ghosts |
| Blue g | Frightened ghost |
| . | Pellet |
| o | Power pellet |
| # | Wall |
Development
npm install
npm test
npm run checkTry the extension locally:
pi -e ./extensions/index.tsThen run:
/pac-manPackage Notes
Pi loads TypeScript extensions directly, so this package publishes the source .ts files. Pi core packages are declared as peer dependencies to avoid bundling duplicate Pi runtime packages.
License
MIT
