MRPGI/mrpgi
type-two 827797ad1f Web: bake any game into the wasm; never block first paint on audio
The title screen / world picker now works in the browser, not just natively.
`./web/build.sh <folder-of-game-folders>` stages every game inside it plus
collection.json and bakes the lot into one wasm; the engine boots into the
shelf exactly as it does on the desktop. Sixteen cases of Police Squad Quest
come to 2.1 MB total.

- embedded_world() becomes embedded_world_at(prefix), so one bundle can hold
  many games; embedded_games() / embedded_collection_name() are the browser
  twins of world::scan_collection / collection_name.
- The picker is now keyed by String on both platforms and resolved through one
  load_by_key() — a filesystem path natively, an embedded subdirectory in the
  browser — so Mode::Title has a single implementation.
- Esc is a no-op on the web when there is nowhere to back out to. Breaking the
  main loop in a browser just leaves a dead black canvas; found by pressing it.
- ascii_fold() on every game-text draw. macroquad's built-in font has no em
  dash, curly quote, star or dagger, so room names like "— Squad Room —" and
  every death card were drawing tofu boxes in both builds. Folding at the draw
  layer fixes the whole engine without making game authors type worse prose.
- web/build.sh uses the rustup toolchain explicitly: cargo/rustc on PATH may be
  Homebrew's, which ships no wasm32 std even though `rustup target list` shows
  the target installed, and the resulting "can't find crate for core" is a
  thoroughly misleading error.

Verified in a real browser: shelf renders, arrows move the selection and swap
the live room preview, Enter loads and plays the case, Esc returns to the shelf
with the selection preserved. Native --shot and all 13 core tests still pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 18:39:48 +10:00
..
src Web: bake any game into the wasm; never block first paint on audio 2026-07-27 18:39:48 +10:00
Cargo.toml GUI: enable macroquad audio feature (cues and music were silently disabled) 2026-07-26 10:30:38 +10:00