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

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

One HTML file. Save it and open it in any browser.Open full screen

Example: Gnome Pop Garden, a 45-second gnome-popping reflex game.

Press Start round or Space, then tap gnomes as they rise from the nine garden beds, or hit keys 1–9. Red gnomes give +1 and golden gnomes give +3. Leave the sleeping hedgehogs alone, because each bump costs 2 points. Pop 5 gnomes in a row for a bonus. The game speeds up through 5 levels. Use the mute button or press M to silence the sound.

Written by AI from this prompt. Your results will vary.

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 in Simple HTML Games