Build a Reaction Time Tester Game with False-Start Detection in One HTML File
Get a polished reaction time test with random delays, false-start penalties, a five-attempt average and an SVG results chart, all in one HTML file.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as a senior front-end developer and game designer who ships polished browser mini-games.
Build Signal Snap, a reaction time tester themed like a night-time railway signal lamp. Each round has five valid attempts. A large panel turns red, waits a random delay, then turns green, and the player reacts as fast as possible. The final score is the average of the five attempts plus penalties.
Rules:
1. Controls: pointerdown on the panel (mouse or touch), plus Space or Enter anywhere. Ignore key auto-repeat. Measure time with performance.now() from the moment green appears.
2. Random delay between 1.5 and 4.5 seconds. Tapping during red is a false start: show an amber warning, add a 50 ms penalty to the final score, and replay that attempt without counting it.
3. States: idle, waiting, go, result shown, false start, and finished with a final score and a short rating label. Include a New round button.
4. Show stat cards for attempts done, last, best, average and false starts, plus an inline SVG bar chart of all five attempts with dashed placeholders for missing ones, the best bar highlighted, and a dashed average line.
5. Dark navy palette with red, green and amber signal colors; white text with strong contrast; fits 360 to 1280 px; an aria-live status line; disable the pop animation under prefers-reduced-motion.
6. Web Audio tones only, created on the first press, quiet, with a visible mute toggle. No external files, storage or alerts.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.Example output
Tips and common edits
Why this works
- Naming every state (idle, waiting, go, false start, finished) stops the model from merging them into buggy logic with double-counted taps.
- Requiring pointerdown and performance.now() gives accurate timings and avoids the slower click event on touch screens.
- Asking for an inline SVG chart with placeholders makes the results view look finished from the very first load.
Paste into ChatGPT, Claude or Gemini. Save the returned code as signal-snap.html and open it in any browser, or run it in the chat's preview or canvas panel. No setup or internet needed.
Common edits
- Change the attempt count, the delay range or the 50 ms penalty to make the test harder or friendlier.
- Retheme it as a starting pistol, traffic light or space launch by swapping the colors, wording and tones.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a Color Sequence Memory Game with Synth Tones in One HTML File
A ready-to-paste prompt that builds Echo Garden, a four-pad color-and-shape sequence memory game with Web Audio tones, a strict mode and rising speed.
Build a Word Scramble Puzzle Game with Hints, Categories and Streaks in HTML
A prompt that produces a single-file word scramble game with themed categories, paid letter hints, streak bonuses, and both typing and tile-tapping controls.
Build a Four-Lane Rhythm Tap Game with a Generated Beat in One HTML File
A ready-to-paste prompt that builds a complete four-lane rhythm tap game with a live Web Audio beat, Perfect/Good/Miss timing grades, combo scoring and a results screen.
Build a Garden Caterpillar Snake Game with Swipe and Wrap Mode in HTML
A prompt that produces Leafline, an original snake-style game where a caterpillar eats garden leaves, with swipe controls, buffered turns, wrap mode and a speed slider.
Build a Gnome-Popping Whack-a-Mole Game With Decoys in One HTML File
A ready-to-paste prompt that makes an AI build Gnome Pop Garden, a fast whack-a-mole style tapping game with speed that ramps up, hedgehog decoys that cost points, and number-key controls.
Build a Match-Three Tile Swapping Puzzle with Cascades and Combo Scoring
Generates a complete single-file match-three puzzle with swap validation, gravity refill, chain-reaction combo scoring and an automatic reshuffle when no moves remain.