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
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
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 like this
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 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 One-Button Fox Endless Runner Game in a Single HTML File
A ready-to-paste prompt that produces Ember Fox Dash, a polished one-button forest runner with coyote-time jumps, fair obstacle spacing, rising speed and synthesized sound.
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 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.