Build "The Pumpkin Test" — a Halloween take on the watermelon rubber-band challenge. One self-contained HTML file: Three.js bundled inline (no runtime CDN), English UI.
THE TOY
A carved jack-o'-lantern sits on a porch at night. Tap it (or press Space) to stretch another rubber band round it. Every band adds pressure until, at a random limit, it bursts.
- Pumpkin: an oblate, ribbed solid (10 slightly irregular ribs, dimples at the stem and the blossom end), defined as a radius for every direction so it is easy to sample, ray-cast and wrap. Use lookup tables so reshaping a 97×241 vertex grid takes about 1 ms. A curved, twisted, ridged stem.
- Bands lie in pairs of opposite grooves, run over the top beside the stem and under the bottom, and bridge the dimples tautly. Each band snaps on from slightly bigger than the pumpkin. Bands in the same groove sit side by side. They pale as they stretch. Colours: black, purple, lime, orange and natural tan.
- As the pressure builds: the pumpkin sags and spreads, the banded grooves deepen and the ribs bulge. The carved face slowly changes from a toothy grin to a wobbly grimace with wide, tilted eyes. The candle inside flickers harder. Near the limit, glowing cracks open along the crowns of the bulging ribs and leak candle light. The pumpkin trembles, holds its breath for a moment, then bursts.
- Burst: the shell splits along the cracked crowns into rib wedges (rind outside, orange flesh inside, jagged cut walls) that fall open like petals. The stem cap flies up and the bottom skids aside, leaving the tealight candle standing. Flesh chunks, about 55 seeds, strings of pulp, broken and whole bands, juice drops and splats on the boards. Seven bats fly out. The camera shakes. A second later the candle goes out with a curl of smoke and the scene darkens.
- Debris: rigid bodies touching the boards at contact points (sequential impulses, friction, sleeping), kept inside the visible area.
- End card: "Well…" / "N bands." / which kind it was, with a "Carve another" button. Three kinds with different limits and knock sounds: thin-walled (30–40 bands), a carving pumpkin (44–56), a thick-walled field pumpkin (58–70).
LOOK
- Rind shader: orange with darker grooves, fine streaks, freckles and a green-brown shoulder. The face is carved procedurally (SDF eyes, nose and toothy mouth in the rind's own coordinates). The holes glow hot yellow, deepening to orange at the cut, with a thin band of lit flesh and a faint warm halo. A point light just inside the face warms the boards in front.
- Stage: weathered porch boards fading into darkness, fallen maple leaves, low drifting mist. A warm porch lamp casts the shadows, with cold moonlight behind. CSS night sky with stars, a full moon and silhouetted bats.
- Typography: masthead "The Pumpkin Test" in Grenze Gotisch with "Pumpkin" in ember orange. Captions in IM Fell English italic. Counters in JetBrains Mono. Deliberately dark, single theme.
UI
Masthead top-left with "How much pressure can it take?". Quiet controls top-right: Knock (K), Reset, Sound. Bottom centre: "Bands: N", a caption ladder ("Tap the pumpkin to add pressure" → "Everything seems fine." → "Probably still fine." → "Jack is under pressure." → "This feels cursed." → "Maybe stop.") and a thin pressure bar that turns ember-orange near the end. Knocking describes the sound ("Hollow and papery. Thin walls." … "The pitch is climbing." / "Ringing. Any moment."). A ripple ring in the band's colour at each tap. Drag to turn the pumpkin. The pumpkin drops in with a bounce.
SOUND (synthesised, Web Audio, no background ambience)
Band snaps that rise in pitch with pressure, rind creaks, knock tones per kind, a burst with a wet slap and band pops, thuds of landing pieces, the candle going out, bat chirps and wing flutter.
Must work on phones (touch, bottom HUD). Respect prefers-reduced-motion. Show a fallback without WebGL. Expose a test hook. Test headlessly: tapping, Space, knock, drag, sag and spread, burst, the end card, "Carve another", reset, a phone layout and no console errors. Deliver the HTML file and publish it as an artifact.