spec-02-ghost-pen-release
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.
PacMan like
Vamos a crear un juego de PacMan como el juego de PacMan original, pero con una interfaz gráfica más moderna y sencilla.
Tecnologías
- Vanilla JS
- HTML
- CSS
Spec Driven Development
El proyecto sirve para aprender este enfoque de desarrollo.
Languages
JavaScript
90.3%
CSS
6%
HTML
3.7%