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.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
Act as a senior front-end game developer who ships polished casual browser games.

Build Dusk Tower, an original tower stacking game where glowing city floors rise into an evening sky. A block slides back and forth above the tower. The player drops it with one input, and any part hanging past the floor below is sliced off and tumbles away, so the next block is narrower. If a block misses the tower completely, the game ends.

Rules:
1. Controls: tap or click anywhere on the play area, or press Space or Enter. The first input starts the game, and an input after game over restarts it. Ignore key repeat.
2. Perfect drops: landing within 5 units of the floor below snaps the block into place and counts a streak. From the third perfect in a row, each perfect regrows width by 12 units, up to the starting width.
3. Scoring: show floors, best score (in memory only), and current streak. Slide speed rises with every floor, up to a cap.
4. Layout: draw on a canvas that resizes with the window and fits 360 to 1280px wide. The camera eases upward as the tower grows. Use a dusk navy-to-plum sky with floors whose hue shifts slowly, and give the floors lit windows.
5. Sound: use Web Audio only, starting on the first input. Play a rising pitch for each perfect in a streak, a noise burst for slices, and a falling tone for game over. Keep the volume low and include a visible mute toggle.
6. Accessibility: when prefers-reduced-motion is set, disable camera easing and spinning debris. Keep text contrast readable and add an aria-live score announcement.

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: Dusk Tower, a one-tap tower stacker set against an evening skyline.

Tap, click or press Space to start. A glowing floor slides across the screen; drop it on the tower. Any overhang is sliced off and falls away, so your next floor is narrower. Land almost exactly on the floor below to score a Perfect. From the third Perfect in a row, each one widens your block again. Speed climbs with every floor. Use the sound button to mute.

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

Tips and common edits

Why this works

  • The slice math is spelled out (overlap kept, overhang dropped, a full miss ends the run), so the model builds the core loop correctly first time.
  • A fixed 400-unit world scaled to the canvas keeps the gameplay identical on phones and desktops while the canvas still resizes.
  • Naming the exact inputs, states and audio triggers means there are no guesses about restart, key repeat or browser autoplay rules.

Paste into ChatGPT, Claude or Gemini. Save the returned code as dusk-tower.html and open it in any browser, or run it in the chat's preview or canvas panel.

Common edits

  • Change the theme: ask for ice blocks in an arctic night or candy layers on a pink sky, and keep the same mechanic.
  • Tune difficulty by changing the perfect tolerance (5 units), the regrow amount (12 units) or the speed cap.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Simple HTML Games