Explorer’s Lab › Orbit Lounge › Build log
Build log
Fix the title card getting stuck over a new game
From the second game on, the title card could come back during the power-up and the new game started hidden behind it, with Insert coin doing nothing. Fixed and tested over three games in a row.
Goal
Derek sent a screenshot of the title card showing over a game in progress: the display read “0 · BALL 1 · 1×”. Insert coin did nothing. He had seen it before.
What was done
- Cause: a bug added with the power-up sequence (2026-11-24).
- After a game over, the title card appears.
- Insert coin hides it and starts the 2.5 s power-up. The game stays in its “game over” state until the power-up finishes.
- The game-over handler in the main loop (state is game over, title hidden) ran again and showed the title card. Its power-down did nothing, because the board was mid-boot.
- The power-up then started the new game behind the card. Insert coin only acts when no game is running, so it was a dead end. The first game after loading the page was never affected, because it starts from attract mode rather than from game over.
- Fix in
src/main.ts:- Inserting a coin after a game over now leaves the game-over state straight away (
game.quit()). - The game-over handler ignores the power-up.
- Safety net: if the title card is ever up while a game is running, Insert coin (or a click on the card) returns to that game instead of doing nothing.
- Inserting a coin after a game over now leaves the game-over state straight away (
What broke / dead ends
None. The bug was the dead end.
Human interventions
Derek reported the bug with a screenshot.
Verification
- Headless Chrome test: insert a coin, force the ball to drain on ball 3, wait for the title card, then repeat.
- Against the old build, it reproduced the bug on the second game: state
ready, ball 1, title card showing. - Against the fixed code, three games in a row each started with the title card hidden, and each game over brought the card back.
- Against the old build, it reproduced the bug on the second game: state
npm run typecheck,npm test,npm run buildandnpm run check: all pass.- Not verified: a game that ends with a high score (the initials path). It goes through the same handler and fix, but wasn’t covered by the test.
Next steps
None.