Commit Graph
4 Commits
Author SHA1 Message Date
luriasb 66100a7b74 release ghosts from the pen via door target and staged exit
SPEC 01's four archetypes never left the ghost pen. With Pac-Man starting
below the pen, greedy Manhattan pursuit scores `up` as the worst option
from every cell inside, so the door is never chosen and all four ghosts
walk a closed loop forever. The bug predates SPEC 01: the original
`hunter` ghost was trapped too, and only the removed `random` ghost
escaped by luck, masking it.

Fixes it by aiming ghosts at the door while they are inside a PEN box,
then gating the release one ghost per GHOST_RELEASE_FRAMES.

The box deliberately includes row 12, the two door cells. Stopping at
row 13 would hand control back to the archetype while the ghost is
still in the doorway, and its target below would pull it back inside.

Measured on the first life with Pac-Man idle: the four ghosts clear PEN
at frames 51, 90, 160 and 240, all before the 300-frame criterion.
The release replays after a death because resetPositions zeroes
game.frame.

Implements SPEC 02 and closes the unmet acceptance criterion it leaves
in SPEC 01. The game stays deterministic; no randomness is introduced.
2026-10-18 01:12:38 -06:00
luriasb d150e4bebc implement four distinct ghost archetypes
Replace the generic hunter/random split with the classic four: Blinky
chases directly, Pinky ambushes 4 tiles ahead of Pac-Man, Inky flanks
using Blinky reflected over a pivot 2 tiles ahead, and Clyde chases
when far and retreats to its corner when within 8 tiles.
2026-10-17 00:53:13 -06:00
luriasb a08eb8af32 add spec 2026-10-16 12:17:18 -06:00
luriasb 3d7ab0046f first commit 2026-09-27 01:59:14 -06:00