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.
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 game developer who specializes in browser audio. Build Lantern Beat, an original four-lane rhythm tap game where glowing paper lanterns drift down a dusk-blue night sky toward a golden hit line. Generate the music live with the Web Audio API: a synthesized kick, filtered-noise snare, hi-hat and triangle bass at 112 BPM, scheduled slightly ahead on the audio clock, with a one-bar count-in and a set of about 50 seconds. Build the note chart from a seeded random generator so density rises through intro, groove and peak sections, with occasional two-lantern chords at the peak.
Rules:
- Controls: D F J K or the arrow keys for lanes 1 to 4, or tap or click a lane. Space starts, Esc pauses, M mutes.
- Grade each press against the audio clock: Perfect within 50 ms, Good within 110 ms labelled early or late, and Miss for bad timing or a lantern that passes the line. Show score, combo, accuracy and counts, then a results screen with a letter grade.
- Each hit plays a pentatonic note for its lane. Create the AudioContext on the first click or key press, keep volume low and show a visible mute toggle.
- Layout: responsive canvas for 360 to 1280 px wide frames, four warm-to-cool lane colors, a HUD above the field, and a start overlay with keys and a timing legend.
- Respect prefers-reduced-motion by turning off sparks and rising text. Pause automatically when the tab is hidden.
- Use no external files, libraries, fonts or storage.
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
- Note timing and judging both read the AudioContext clock, so the grades stay in sync with what you hear even when frames drop.
- Scheduling drum hits about 150 ms ahead keeps the beat steady without audio files or libraries.
- Exact timing windows, controls and section structure leave the model nothing to guess, so the first build is playable.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as lantern-beat.html and open it in any modern browser, or run it in the chat's preview or canvas. Turn your sound on.
Common edits
- Change the BPM, the number of bars or the probability values in the chart builder to make the game easier, harder or longer.
- Swap the lantern theme for falling stars or neon tiles by editing the lane colors and the lantern drawing function.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
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 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 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.
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.
Build a Tower Stacking Game with Slice-Off Blocks in a Single HTML File
A ready-to-paste prompt that builds a one-tap tower stacking game where overhangs are sliced off, perfect drops restore width, and the camera follows the tower upward.