A nanoscale arcade game. Shoot charge across the room, wrestle atoms together until they snap, and contain a chain reaction before it eats the field. Vanilla JS + Canvas 2D, no dependencies, no build step. Core systems: - Charge: give/take as the only two verbs. Opposites attract, likes repel. - Laserhands: ranged proton/vacuum bolts with real travel time. Bolts are charged bodies, so they curve through the field — bank shots are real. Give spends from an 8-proton ring, take earns them back. - The wrestle: bonds can't form on their own. Every pair has an activation barrier that parks them at arm's length; Molly's hands are the only way over it. Hold, squeeze, release -> SNAP. - Radicals: the enemy, with no mind. Every 0.32s one grabs its nearest neighbour, completes itself, and hands the wound on. Can't be shot dead — terminated by wrestling two together (barrierless, so 0.38s vs 1.56s). Two that drift into contact self-quench, which gives outbreaks a natural equilibrium instead of unbounded growth. - Overload: keep feeding one atom and it goes critical. The blast tips its neighbours, so density decides whether you get one pop (34 atoms) or 84 detonations from a single seed (116 atoms). - CASCADE: eight arenas of escalating density with finite ignition waves. Clear the field to advance; sustained neglect melts it down. - Membrane, sour/soapy zones, and the seven wordless tutorial rooms. Non-obvious constraints, documented at each constant: - BARRIER_FORCE must exceed MAX_CHARGE_FORCE, or atoms bond themselves and the wrestle (the whole game) gets skipped. - Bond lock distance scales with atom radius. A flat value meant two carbons could never bond at all, since collision held them further apart than the lock — invisible because hydrogen worked fine. - RAD_SPLIT_R must exceed the field's natural packing distance (set by the barrier), or outbreaks can only crawl and never bloom. Testing: 39 headless sim tests run the real physics in Node — no browser, no canvas. The sim draws all randomness from a seeded RNG so runs are reproducible. Perf is 0.32ms/sim-step at 116 atoms. Dev server strips a /v<timestamp>/ path prefix that index.html adds to its entry import, because browsers cache the *parsed* ES module by URL and no-cache headers alone don't touch it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
70 lines
2.7 KiB
HTML
70 lines
2.7 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
<title>Molly Cool</title>
|
|
<style>
|
|
html, body {
|
|
margin: 0; padding: 0; height: 100%;
|
|
background: #05070a; overflow: hidden;
|
|
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
color: #C8D0D8;
|
|
}
|
|
#stage { display: block; width: 100vw; height: 100vh; touch-action: none; cursor: none; }
|
|
#title {
|
|
position: fixed; inset: 0; display: grid; place-items: center;
|
|
background: radial-gradient(ellipse at center, #0b1018 0%, #05070a 70%);
|
|
z-index: 10; transition: opacity .6s ease;
|
|
}
|
|
#title.gone { opacity: 0; pointer-events: none; }
|
|
.card { text-align: center; }
|
|
h1 {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
font-size: clamp(44px, 9vw, 92px); font-weight: 800; letter-spacing: -.04em;
|
|
margin: 0 0 6px; color: #fff;
|
|
text-shadow: 0 0 40px rgba(255,45,155,.5), 0 0 90px rgba(45,184,255,.3);
|
|
}
|
|
.sub { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: #5d6b7a; margin: 0 0 40px; }
|
|
button {
|
|
background: transparent; color: #C8D0D8; border: 1px solid #2b3947;
|
|
padding: 14px 40px; font: inherit; font-size: 13px; letter-spacing: .2em;
|
|
text-transform: uppercase; cursor: pointer; border-radius: 2px;
|
|
transition: all .2s ease;
|
|
}
|
|
button:hover, button:focus-visible {
|
|
border-color: #FF2D9B; color: #fff; outline: none;
|
|
box-shadow: 0 0 30px rgba(255,45,155,.28);
|
|
}
|
|
.keys { margin-top: 34px; font-size: 11px; color: #45535f; line-height: 2; letter-spacing: .06em; }
|
|
.keys b { color: #7d8b99; font-weight: 500; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="stage"></canvas>
|
|
|
|
<div id="title">
|
|
<div class="card">
|
|
<h1>MOLLY COOL</h1>
|
|
<p class="sub">vertical slice</p>
|
|
<button id="start">Begin</button>
|
|
<div class="keys">
|
|
<div><b>WASD</b> move · <b>mouse</b> aim</div>
|
|
<div><b>left click</b> proton bolt · <b>right click</b> vacuum bolt</div>
|
|
<div><b>space</b> hold two things & squeeze · <b>Q</b> heat · <b>R</b> retry</div>
|
|
<div style="margin-top:10px;color:#35414c">aim at your own feet to charge yourself</div>
|
|
<div style="color:#35414c">keep feeding one atom and it goes critical</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="module">
|
|
// Load the module graph under a fresh /v<timestamp>/ prefix each time.
|
|
// Browsers cache the *parsed* module by URL, so without this you can edit a
|
|
// file, hard-reload, and still be running yesterday's code. serve.py strips
|
|
// the prefix back off. Costs nothing in production (drop the prefix).
|
|
import(`/v${Date.now()}/src/main.js`);
|
|
</script>
|
|
</body>
|
|
</html>
|