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.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
You are a front-end game developer who builds polished, accessible browser games in plain HTML, CSS and JavaScript.
Build "Gnome Pop Garden", an original whack-a-mole style tapping game. The board is a 3x3 grid of garden beds. Cheeky garden gnomes pop up out of soil holes, and the player pops them back down before a 45-second round ends.
Rules:
1. Controls: click or tap a bed, or press number keys 1-9. The keys map to the beds left to right, top to bottom, and each bed shows its number. Space or Enter starts a round. M toggles sound.
2. Scoring: a red-hat gnome is worth +1. A rare golden gnome is worth +3 and stays up for less time. A sleeping hedgehog decoy costs 2 points, and the score never drops below 0. Every 5 gnomes in a row earns a +1 bonus. A missed gnome resets the streak.
3. Escalation: the time between pop-ups and the time each critter stays up both shrink smoothly across the round, and decoys get more common. A HUD shows Score, Time, Speed level and session Best.
4. States: a start card with a scoring legend, the playing state, and a time's-up card with stats and a Play again button.
5. Look and motion: draw the gnomes with inline SVG. Use a green garden palette with cream cards. Critters slide up from behind a soil lip, and floating point labels show each score change. Turn off the slide and float motion under prefers-reduced-motion. The layout stays fluid from 360 to 1280px wide.
6. Sound: use Web Audio oscillators only, created on the first interaction, at low volume, with a visible mute toggle. No external files, storage, alerts or forms.
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
- Exact point values, timings and key mapping leave the model nothing to guess, so the scoring logic comes out consistent.
- Banning files, storage and alerts keeps the game runnable offline and inside sandboxed previews.
- Separate start, playing and game-over states give the page a finished look on first load.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as gnome-pop.html and open it in any browser, or run it in the chat's preview or canvas panel.
Common edits
- Change the theme by swapping the gnome SVG and hedgehog for other characters, such as moles and bombs.
- Make it harder by shortening the round, lowering the minimum stay-up time or raising the decoy penalty.
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 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 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 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 Daily Five-Letter Word Guessing Game with Colorblind Mode in One HTML File
A ready-to-paste prompt that produces Quillmark, an original daily five-letter word game with correct duplicate-letter coloring, an on-screen keyboard and a colorblind mode.