Put a menu in front of the game, with Marvin to explain it

The overlay is a four-stage machine now — splash -> menu -> {courts, tutorial}
— swapped by data-stage while the backdrop and card frame stay mounted, so the
live court never flashes through between screens.

Court tiles SELECT only. Tapping one used to start the match on the spot, which
gave you no way to compare the three and no way back out; START GAME and BACK
are their own buttons now. Headlines are 15px against the 11px body, so a screen
reads as a screen rather than as a list.

The tutorial is a data table: a Marvin pose, an optional picture already in
assets/, and his lines. Seven pages covering tennis, the turn, the slingshot,
the rack and the duel. Marvin is four new frames off x_boymop1 — waving,
pointing, shrugging, and clutching his mop in terror.

The theme no longer starts at boot. A title screen that plays at you before you
have touched it is rude, and the autoplay policy would have held it silent until
that first tap anyway.

Death returns to the menu instead of the title. The reload stays — it is the
honest full reset — and a sessionStorage flag is what picks the stage on the way
back in.

Machine-gun rounds are tennis balls, so they are drawn as balls and take the
perspective. A fixed 4x4 fillRect was exactly as big at the far baseline as at
your feet, which read as square confetti pinned to the screen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
wuwiandClaude Opus 5 committed 2026-08-01 13:31:00 +02:00
1 parent 60f7ce2cf1
commit 9a65a50cc4
10 files changed
+199 -44

No files matched your search

+14
View File
@@ -454,6 +454,20 @@ death summary is the end menu, and the zombie bed ducks out as it comes in. Two
bed's gain at 0. Without it, a multi-megabyte file ducked mid-fetch comes up at full level several
seconds later, over the match.
**The overlay is a four-stage machine**, not a screen per DOM node: `#intro[data-stage]` swaps
`splash -> menu -> {courts, tutorial}` while the backdrop and card frame stay mounted, because a
screen that unmounts the overlay flashes the live court through between menus. Court tiles SELECT
only; `START GAME` and `BACK` are their own buttons. The tutorial is a data table (`TUT` in main.js)
of Marvin poses, an optional picture already in `assets/`, and his lines — adding a page is a row.
**The menu theme starts on the FIRST TAP, never at boot** (`go()` calls `menuMusic`). A title screen
that plays at you before you touch it is rude, and on a phone the autoplay policy would have held it
silent until that tap regardless.
**Death returns to the MENU, not the splash.** `maybeRestart` still reloads — that is the honest
full reset and nothing has to unwind a run by hand — but it sets `sessionStorage.splatterStage` on
the way out, and boot consumes it to open at the menu.
**The theme is AAC** (`background-music.m4a`, 768 KB — the WAV was 8.3 MB, and this one downloads on
every page load before the player has decided to play). `loopBed` takes the FULL filename now,
because the beds are a mix of `.wav` and `.m4a`; `fadeBed`'s key must match it exactly, extension