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.
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. Build Reef Swap, an original match-three puzzle set in a moonlit tide pool, as one self-contained HTML file: an 8x8 canvas board with six tile types, each a distinct color and shape (circle, star, triangle, diamond, hexagon, rounded square) for colorblind clarity.
Rules:
1. Only orthogonal neighbours swap. If a swap makes no run of 3+, animate it back with a low buzz and spend no move.
2. Clear all horizontal and vertical runs at once, drop tiles per column, refill from the top, repeat until stable. Score 10 per tile times chain level, plus 20 per extra tile in runs of 4-5.
3. After settling, test every adjacent swap; if none works, announce it and reshuffle until there are no instant matches and at least one move. The opening board obeys this too.
4. Tap-tap or drag to swap; arrows move a cursor, Enter or Space selects, an arrow swaps; H hints, R restarts; auto-hint after 7 idle seconds.
5. 30 moves, HUD for score, moves and best combo, start and game-over overlays, navy palette with one gold accent, fits 360-1280px, snaps under prefers-reduced-motion.
6. Web Audio sounds started on first input, pitch rising per combo, low volume, mute toggle. No external assets, storage or alerts.
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
- Spelling out validate, clear, gravity, refill and repeat stops the model from skipping cascades or leaving invalid swaps in place.
- Requiring a move scan and a reshuffle loop, including on the opening board, prevents dead boards that silently freeze the game.
- Distinct shapes plus colors, keyboard controls and reduced-motion snapping make the game accessible on the first run.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as reef-swap.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 tile palette and shapes, for example candy, gems or space rocks, and rename the game.
- Adjust difficulty by changing the move limit, the board size or the number of tile types (5 is easier, 7 is harder).
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 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 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.
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 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.