A Pac-Man clone written in native Windows Batch (cmd.exe) — no engine, no
dependencies, just .bat files. The maze, ghosts, pellets, fruit, death animation,
and high-score board are all driven by batch script, rendered with ANSI escape
sequences and a hand-built 8×8 sprite font.
- Windows 10 or later
- Runs in native Windows Batch (
cmd.exe), which is single-threaded and CPU-bound — a reasonably modern CPU is recommended for smooth play. Tested on an AMD Ryzen 7 3700X with a little headroom to spare; older or low-power machines may see choppier movement.
-
Install the sprite font. Right-click
BatchPac8x8.ttf→ Install (or open it and click Install). Without it the sprites show up as blank/▯ boxes — see Font setup below. -
Set your console to that font. In the terminal you'll run the game from (Windows Terminal, or the classic
cmd.execonsole), set the font face to BatchPac 8x8. -
Run the game. Double-click
PacBatch.bat, or from a prompt in the repo folder:PacBatch.bat
That's it — map01.dat ships with the repo, so there's nothing to generate.
| Key | Action |
|---|---|
W/A/S/D |
Move up / left / down / right |
P |
Pause / unpause |
L |
Add a life |
X |
Exit |
When a game ends, if your score cracks the top 10 you'll be prompted for initials; the board is shown and you can choose to play again.
The sprites (Pac-Man, ghosts, fruit, score popups, death animation) are real glyphs in
BatchPac8x8.ttf, mapped into the Unicode Private Use Area (U+E000+). The console
must be using this font to render them — in any other font they appear as empty boxes.
- Windows Terminal: Settings → your profile → Appearance → Font face → BatchPac 8x8.
- Classic
cmd.execonsole: open acmdwindow, click the title-bar icon → Properties → Font, and pick BatchPac 8x8. (Custom fonts only appear here after the TTF is installed and may require a sign-out/in.)
A black background is recommended; the game paints its own colors over it.
map01.dat is prebuilt, so you don't need this to play. To build a different level:
- Draw a maze in
PacLevelEditor.html(open it in a browser) and export themapRow[]block, or edit the ASCII maze inPacMazeGen.batdirectly. - Run
PacMazeGen.batto regeneratemap01.dat(movement, pathfinding, pellet, node, and spawn data).
| File | Role |
|---|---|
PacBatch.bat |
The game engine — run this to play. |
PacConfig.bat |
All constants: colors, sprite glyphs, fruit/ghost tables, timing. |
PacMazeGen.bat |
Converts a hand-drawn ASCII maze into map01.dat. |
colorgen.bat |
Generates the per-level spectral wall-color gradient. |
hscore.bat |
Submits a score and renders the top-10 board. |
map01.dat |
Prebuilt level data consumed by the engine. |
BatchPac8x8.ttf |
The custom 8×8 sprite font (install this). |
PacLevelEditor.html |
Browser maze editor (exports levels for PacMazeGen.bat). |
ARCHITECTURE.md |
How it all fits together — render model, data formats, conventions. |
The high-score board is written to highscores.txt next to the scripts the first time you
finish a game; it isn't shipped with the repo.
See ARCHITECTURE.md for the render model (selective ANSI redraws over
conhost), the map01.dat data sections, ghost targeting, the spectral wall gradient, the
sprite-font layout, and the comment/style conventions.
This is a fan-made, non-commercial, educational project, created as a programming exercise. It is not affiliated with, endorsed by, or sponsored by Bandai Namco Entertainment Inc.
PAC-MAN® and all related characters and trademarks are the property of Bandai Namco Entertainment Inc. All other trademarks are the property of their respective owners.