Skip to content

feat(kit): shared game shell, with the Lot and Night Shift on it - #431

Merged
kitlangton merged 15 commits into
mainfrom
game-shell
Oct 22, 2026
Merged

kitlangton merged 15 commits into
mainfrom
game-shell

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What it does. Every game had its own title, pause, volume and quality UI, or none at all. This adds one shared player-facing shell, @arcade/kit/shell: settings (volume, mute on M, quality Auto/High/Balanced/Low, reduce camera motion, key labels), the title and lobby, the Escape menu, the leave-page warning and a loading bar. The Lot and Night Shift move onto it here; each other game follows in its own PR.

How it works.

  • Headless models (ShellSettings, ShellFlow, ShellLobby, ShellLoading, LeaveGuard) and a small default DOM view styled by --shell-* variables. Games keep their own art in titleSlot and pauseSlot.
  • ShellFlow is the one state machine (title → play → pause → play, Leave back to the title). Pointer-lock games pause when the lock goes, and a refused lock never strands the menu.
  • Quality uses a new stepDown: "slow-frames" policy on AdaptiveQualityController: Auto starts at High and steps down only on measured slow frames during play.
  • Saved per game: arcade.volume.<game>.v1, arcade.mute.<game>.v1, arcade.quality.<game>.v1. Old mute and reduce-motion keys are read once.
  • Under automation the overlays are hidden and audio starts muted; ?shell shows them for proofs.
  • Rules and the new-game checklist are in docs/game-shell.md, linked from AGENTS.md.

Fixes from review: lobby errors now show; M and Escape work after using a slider; Leave from the pause menu leaves the room; a final "lost" connection isn't overwritten; audioRuntimeSync turns off the audio runtime's own M; Night Shift's quality applies with the Lab look off. Cards that don't fit the window scroll with an edge fade, and the mute and gear icons get their own row above the title.

Risk. Player-facing UI and input in the Lot and Night Shift only. Kit additions are new modules or opt-in options, so other games are unchanged until their own PRs. Smoke readiness accepts the old selector or .arcade-shell. The Lot's quality setting is new (High is its old 1.5× cap).

Proof.

Lot title at 1280×720 and Night Shift title at 1920×1080 (both fit without scrolling):

  • bun test --max-concurrency 4 packages/kit/shell.test.ts: 23 pass (Escape with a slider focused, Leave leaving the room, lost status, audio M, Play alone clearing the invite).
  • Earlier targeted set: kit shell, quality, controls and architecture-map: 37 pass.
  • tsc for packages/kit, Lot, Night Shift and root scripts: clean.
  • Lot smoke run alone: passed.
  • bun scripts/prove-game-shell.ts lot nightshift: title, Settings and pause in both; the title fits at 1280×720 and 1920×1080 (overflow 0).

…hift on it

Headless settings (volume per channel, mute on M, quality Auto/High/Balanced/Low,
reduce camera motion, key labels, game sections), one title/pause/settings flow with
pointer-lock handling, lobby model (name, rooms, invite, players, ready/start,
reconnect state), leave-page guard and loading progress, with small default DOM views
styled by --shell-* variables. Quality gets a slow-frames step-down policy so Auto
starts High and steps down only on measured slow frames (createShellQuality).

docs/game-shell.md holds the rules, new-game checklist, per-game audit and the woods
adoption note; AGENTS.md points to it.
…Leave leaves the room, lost stays lost, the audio sync owns the runtime's M; Night Shift quality applies with the look off
…ir own row; proof shoots titles at 720p and 1080p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant