A 30-racer obstacle race: many-body 2D physics, spinning sweepers, a torque seesaw, varied AI racers and honest race counters.
A 30-racer obstacle race: many-body 2D physics, spinning sweepers, a torque seesaw, varied AI racers and honest race counters.
No runs posted yet. Be the first: post yours and tag @wikiwayne.
GUMDROP GAUNTLET: 30-Racer Obstacle Party
HOOK OBJECT: window.__gauntlet
Build "GUMDROP GAUNTLET": a side-view obstacle-course party race in Canvas 2D (no libraries). Thirty squishy gumdrop racers sprint through a candy-colored course of spinning sweepers, a tipping seesaw, bounce pads and a slime pit, bumping, tumbling and wobbling, and only the first 10 across the line qualify. You can drive one racer or just watch the chaos.
LOOK
- Style: glossy candy cartoon with thick outlines #2B1D3A, soft gradients and shine spots. Sky gradient #8FD3FF to #FDE7FF; course pieces in pink #FF6FB1, mint #5EE6B5, lemon #FFE36E and grape #9B6BFF.
- Racers: 30 gumdrop-shaped blobs (a rounded dome on a flat base, about 48 px tall on a 1280x720 screen), each a different color, with two big eyes that look where they're going. They squash on landing and stretch on jumps. Your racer wears a small gold star.
- Course, side view, about 6,400 px long and scrolling: start gates, 2 spinning sweeper bars, a seesaw bridge over a gap, a row of 5 bounce pads, a slime pit to jump (racers who fall in respawn at the last checkpoint after 2 s), and a finish arch that bursts confetti.
- HUD: top-left "QUALIFIED N/10", top-right "YOUR PLACE N/30", and a thin course strip along the top with a dot for every racer. Readable in a paused frame, never over the racers.
- FIRST FRAME (t = 0, no input): the start gates with all 30 racers packed in and bouncing in place, a big 3-2-1 countdown and the first sweeper in view. The gates and the racer pack fill at least 50% of the screen height.
MOTION / PLAY
- Hand-written physics: gravity 1,800 px/s², run speed 260–320 px/s (each AI racer a little different), jump speed 640 px/s. Racers collide and push each other, never overlapping by more than 3 px.
- Sweepers spin one full turn every 2.5 s and knock racers flying in the direction they sweep; a knocked racer tumbles and gets back up after 0.6 s.
- The seesaw tips toward the side carrying more weight (real torque from the racers on it), not on a timer.
- Bounce pads launch racers about twice as high as a normal jump.
- AI racers run and jump at gaps and pads, but mistime about 15% of jumps, so there are real falls and pile-ups. A racer stuck in one spot for more than 4 s hops free.
- You: arrow keys or A/D to run, Space or W to jump. On phones: left, right and jump buttons at least 56 px.
- The camera follows your racer smoothly (the leader in attract mode) and never jitters. This 2D game's camera setter is setCamera(courseX, zoom): courseX in px from the start line, zoom 1 = default.
- The race ends when 10 have qualified. The other 20 turn gray and slump as ELIMINATED, a results board shows for 3 s, and a new race starts.
- ATTRACT MODE: with no input, a hands-free demo starts on load: all 30 racers are AI, the camera follows the leader, and a full race from countdown to the 10th finisher takes 25–30 s. Any input hands you racer #1; the demo resumes after 8 s with no input.
SOUND
- Countdown beeps and a whistle at GO.
- A boing for each bounce pad launch, a soft squish on landings (pitch varies by racer), and a thwack when a sweeper hits someone.
- A gloopy slurp when someone falls in the slime.
- A cheer and a ding each time a racer qualifies, and a sliding horn "wah-wah" if the race ends with you eliminated.
COUNTERS
stats() returns { fps, qualified, eliminated, knockdowns, slimeFalls, padBounces, races }.
- qualified: +1 exactly when a racer's body crosses the finish line (10 per race). Never on load, never on a timer.
- eliminated: +20 when the race ends and the non-qualifiers visibly turn gray.
- knockdowns: +1 each time a sweeper or a collision knocks a racer off its feet and it visibly tumbles.
- slimeFalls: +1 each time a racer falls into the slime.
- padBounces: +1 per bounce pad launch.
- races: +1 when a race ends.
CHECKS for ?test=1
With ?test=1, run an accelerated self-test that measures real positions and real events (not self-set flags) and logs "TEST n PASS" or "TEST n FAIL: reason" to the console and to window.__testResults:
1. All 30 racers exist, and over 20 s of simulated racing no two racers overlap by more than 3 px for more than 2 frames in a row.
2. Every sweeper hit pushes the racer in the sweeper's direction of motion and adds exactly 1 to knockdowns; no racer ever passes through a sweeper, a platform or the ground.
3. With racers placed on only one side of the seesaw, its angle tips toward that side within 1 s, three times in a row, switching sides.
4. qualified stops at exactly 10 and matches the number of racers whose bodies crossed the finish line; slimeFalls matches the number of slime respawns.
5. A full AI race run with advance() ends in 25–30 s of game time, races goes up by exactly 1, and the run has zero console errors.
KEEP IT SHORT
- Keep the whole file under about 1,500 lines (soft target) so you can write it in one pass and finish well inside 15 minutes.
- Save lines with helpers, loops and instancing, not by dropping features. Everything above must really work: no placeholders, no TODOs.
BUILD RULES (all required):
- Deliver ONE self-contained HTML file: inline CSS and JS, no build step, no local assets. Libraries only from a CDN. If you use Three.js, use exactly this import map: {"imports":{"three":"https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js","three/addons/":"https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/"}}
- It must open straight from disk in desktop Chrome and on an iPhone (Safari), fill the full screen, handle resize and touch, and stay smooth (target 60 fps).
- It must look stunning in the very FIRST frame: no black screen, no loading wait, no tiny subject. The main subject fills at least 50% of the screen height.
- SOUND (required): all sound is made in code with Web Audio (no audio files). Show a small "🔊 TAP FOR SOUND" chip; on the first tap create ONE AudioContext, route everything through a master gain of 0.6 into a DynamicsCompressor, and hide the chip. Also expose enableAudio() on the hook object named at the top.
- Expose the hook object named at the top with: setCameraOrbit(azimuthDeg, elevationDeg, distance) (or an equivalent camera setter), advance(seconds) that steps the simulation exactly that much for still captures, enableAudio(), and stats() returning {fps, ...the counters named above}. Use a fixed random seed of 360 so every run is the same.
- Every on-screen counter must count a real event you can see happen. No fake numbers.
- No text overlapping the subject; any label must be readable in a paused frame.
- No brand logos, no real people, no copyrighted characters, brand names or logos.
FAILURE MODES TO AVOID
- Racers merging into one blob, overlapping, or jittering in place.
- Racers walking through sweepers, falling through platforms, or stuck forever.
- A seesaw that moves on a timer instead of from weight.
- All AI racers moving in perfect lockstep. They must differ in speed and timing.
- Counters that tick on their own. QUALIFIED must match racers actually across the line.
- A camera that jitters or loses the racer it follows.
- A tiny, unreadable HUD, or a HUD over the racers.
- The same variable declared twice, or methods called on objects that don't exist yet.
SELF-TEST LOOP
- If you can run code: build the file, open it, read the console, run ?test=1, and take screenshots at 3 s, 10 s and 30 s at 1280x720 and 390x844. Look at the screenshots and fix what looks wrong. Fix and retest until all 5 checks pass with zero console errors. Mark anything you could not run as UNMEASURED; never invent results.
- If you are chat-only: go through this prompt line by line, check your code against each line, and fix anything that would fail. Then write one corrected, complete file.
- Final answer: ONE complete HTML file in ONE code block, then the 5 checks marked PASS, FAIL or UNMEASURED. No snippets, no "rest unchanged".
Built one? Post it on X and tag @wikiwaynePost on X