Explorer’s Lab › Orbit Lounge › Build log
Build log
The board powers up when you insert a coin
The table now starts switched off. Insert coin plays a short power-up: coin clink, relay clunk, flickering lamps, a wave of light up the playfield, a double flash, then the game and music begin. It powers down again after the game.
Goal
Derek asked for the board to look turned off at the start, then come alive with everything lighting up in sequence when the player inserts a coin.
What was done
src/game/power.ts: a small state machine (off → booting → on → shutting) with a timed sequence:- 0 s: coin;
- 0.35 s: relay clunk and flickering lamps;
- 0.9 s: sweep;
- 1.95 s: double flash;
- 2.45 s: ready.
- Renderer:
- lights, lamps, environment reflections and the backglass all follow the power level;
- inserts, bumper caps, slingshots and standups are dark when off;
- during the sweep they light as the wave passes their position;
- they flash together at the end.
- Display: blank with no power; CREDIT 1 · PLEASE WAIT while booting; then GOOD EVENING.
- Sounds: coin clink (it waits for the browser to unlock audio, which happens on the same click), relay clunk, sweep ticks and a power-up chime. The music stays silent until the board is on.
- Controls: any key skips the sequence. Keys are now tracked while controls are disabled, so a key held through the power-up (such as the plunger) takes effect as soon as play starts.
- Power-down when the title card returns after a game (after initials), or on Quit to title.
Verification
- Typecheck clean; build and
npm run checkpass. The smoke test (click Insert coin, then immediately hold keys) now exercises the skip and the held-key carry-over, and the ball launches. - Headless frames captured at load (dark board, blank display), 0.6 s (lamps), 1.35 s (sweep mid-table), 2.1 s (full flash, CREDIT 1) and 3.2 s (ready: GOOD EVENING). No console errors.
- Not verified: how it feels and sounds in person, especially the coin and relay sounds.