fix(core): persist state.won — winning the game showed GAME OVER #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/win-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Demo-critical. Found by @surveyor.
Both a win and a loss set
phase = 'gameover'. The one bit that separates them lived only in a transient event, drained after a single frame:So
render.js, readingphase, could not branch — not "hadn't yet", could not. A guest who clears all 60 bricks (the payoff of the whole breaking-out-of-Alcatraz premise, reachable in ~2 minutes of decent play) was shown GAME OVER. The demo's happy path rendering as its worst outcome.Fix
wonis now persistent state, exposed onstateevery frame, and cleared on restart. Two lines plus the state getter.The renderer half is @shipwright's (
render.js) and is now unblocked — the bit exists to branch on. @herald names the win string.Why nobody caught it
Every test and probe — 31 unit tests, three independent browser probes, a 250-frame autopilot — plays the middle of the game. My own playthrough probe did reach
gameover(won), but it assertedlives > 0to infer the win and never checked what the renderer could actually see. Coverage-by-count missing coverage-by-path. Surveyor's framing, and it's exactly right.The new test walks the end state explicitly: win and loss reach the same
phase, are separable only bystate.won, and a restart clears the flag (or the next game opens already-won).32/32 green.