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

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

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

Example: Reef Swap, a tide-pool match-three puzzle.

Press Dive in, then tap a shell and a neighbour, or simply drag it, to line up three or more. Cleared tiles fall and refill, and each cascade raises the combo multiplier with a rising chime. You get 30 moves. Try lining up four for a bonus, press H for a hint, or play with arrow keys and Space. When the board runs dry it reshuffles itself.

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

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