HardYards/web/world/index.html
m3ultra 2b66ce4b9a Give the game a face: HUD, mouse prep, forecast and aftermath (gate 1)
SPRINT4 §Lane A 1-5. Everything the game already simulated was invisible to a
stranger; you can now play a whole round with eyes and a mouse and never open the
console.

hud.js only ever READS — it takes no decisions and owns no state worth keeping,
so it can be this chatty without anything drifting. Corner load bars are
world-anchored rather than screen-anchored because a number in the corner of the
screen can't tell you WHICH shackle is about to go, and that is the entire
"...the shackle, I knew about the shackle" moment. They hold constant screen size
with distance: a house corner is 18 m away from the posts, where a world-sized
bar is a few unreadable pixels.

Prep is Lane B's createRiggingUI wired to the phase machine — their picking was
already complete, this is the hands. Forecast reads the three authored storms, so
the difficulty select came free: Sea Breeze / Southerly Buster / Wild Night with
real peak wind, gust character and change time.

Two bugs the wiring surfaced, both found by playing rather than reading:
- The rigging session survived "play again": a second round started at $35 with
  three corners already hung, and the four anchors you clicked were silently
  ignored because the session was full. resetRig() walks it back through the
  session's own public moves, so the economy stays the one source of truth.
- The forecast card's lifetime was owned by its own button, so any other route
  into prep left a card floating over a live game eating input. The phase owns it
  now.

Verified by playing it: good rig on the wild night wins at 53%, the same yard's
cheap drum-tight span loses 4 corners, the gentle night with a good rig ends at
93% "not a leaf out of place". Selftest 184/0/0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 02:32:02 +10:00

48 lines
1.6 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>SHADES — rig it, then survive the night</title>
<style>
html, body { margin: 0; height: 100%; overflow: hidden; background: #9fc4dd; }
canvas { display: block; width: 100%; height: 100%; }
#dev, #help {
position: fixed; left: 10px;
font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
color: #eef4f8; text-shadow: 0 1px 2px #0009;
pointer-events: none; user-select: none;
}
#dev { top: 10px; }
#help { bottom: 10px; opacity: .75; }
#banner {
position: fixed; top: 38%; left: 0; right: 0;
text-align: center; pointer-events: none; user-select: none;
font: 700 42px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
letter-spacing: .18em; color: #fff; text-shadow: 0 2px 12px #0007;
opacity: 0; transition: opacity .45s ease;
}
</style>
</head>
<body>
<canvas id="c"></canvas>
<div id="banner"></div>
<div id="dev">booting…</div>
<script type="importmap">
{ "imports": { "three": "./vendor/three.module.js",
"three/addons/": "./vendor/addons/" } }
</script>
<script type="module">
import { boot } from './js/main.js';
// boot() is async now — it fetches two storm defs, the ped, the clip pack
// and Lane E's debris GLBs. Surface a failure on the page rather than
// letting it die as an unhandled rejection behind a blue screen.
boot().catch((err) => {
console.error(err);
document.getElementById('dev').textContent = `BOOT FAILED — ${err.message} (see console)`;
});
</script>
</body>
</html>