# Gem Cascade: A Match-Three Puzzle With Cut 3D Gems

> Swap cut 3D gems on an 8×8 tray to make lines of three or more, in one offline HTML file: lines pop, gems fall and chain clears score double, triple and more; each round has 20 moves and a 4,000-point target with up to three stars, plus a hint, a reshuffle when no move is left and autoplay. Gems, lighting and sounds are generated in code.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Game creation](https://www.sandbase.ai/skills/games)
- Version: 0.1.2
- Runs online: yes
- Page: https://www.sandbase.ai/skills/games/gem-cascade

## What you get

Bring gem colours and cuts, a backdrop and the words on screen, and optionally the board size, scoring and moves. The Skill returns a downloadable Skill (the reference game project, a customize guide, headless verification) and one playable example round.

## Install

Download the Skill package from https://www.sandbase.ai/skills/games/gem-cascade (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/gem-cascade make a match-three game with <your gems>, on <your backdrop>, with <your rules>
```

## How it works

1. **Copy the finished game** Gem Cascade starts with node scripts/new-project.mjs --out my-gems and npm ci. The project is already a complete match-three: rules, chains, reshuffle, hint, autoplay, round end, the 3D view, HUD, touch input, sound and the window.__scene test API. A prompt such as "Use gem-cascade to make a match-three game with sea glass, on a slate backdrop, with 25 moves" sets the restyle.
2. **Edit rules and look** Most changes go in src/config.js, and references/customize.md lists files and traps for colours, cuts, backdrop, words, board size, scoring, speed, sound and a new gem kind. The default is an 8 by 8 tray of seven gem kinds on dark plum, 20 moves and a 4,000-point target. A line of three scores 100, each extra gem 100 more, and chain stage k counts k times.
3. **Shoot and deliver one file** npm run build:single writes dist-single/index.html, at most 8 MiB, which opens with a double-click. npm run shoot needs local Chrome and writes shots/report.json and shots/*.jpg. It covers select, swap, a chain, a swap that slides back, hint, a drag swap, a reshuffle, autoplay, the end card, play again and a 390 by 844 phone. Every check must read ok.

## FAQ

### Does Gem Cascade have special gems or levels?

No. Gem Cascade has no striped gems, bombs, obstacles or level maps; every round uses the same board size and rules with a move budget. It also has no online leaderboard or saved best score, because the sandbox blocks network and storage, so the score lives for the session.

### What happens when Gem Cascade runs out of moves on the board?

Gem Cascade deals the board again when no swap is left, with no lines and at least one possible swap, and keeps the score and moves. A swap that makes no line slides back without using a move. Hint marks one possible swap.

### Is the Gem Cascade autoplay smart?

No. Gem Cascade autoplay is a greedy one-move player that picks the biggest first clear, lower rows first. It is not an optimiser. It exists so the game can play itself and so verification can confirm that moves score.

### Does Gem Cascade need a key or WebGL 2?

Gem Cascade needs no key and calls no model or paid service; every gem is cut from geometry in code and lit by a generated environment. It does need WebGL 2. Without it the page shows nothing and posts an error message to the parent frame.

### Can a Gem Cascade round be timed?

Gem Cascade has no built-in timer. It ends a round in settle() in src/logic/round.js when movesLeft reaches 0. A timer would end it on the clock instead and needs its own HUD value and its own verify.json step. When you change a number a step asserts, change the step too.

### Does Gem Cascade work on phones?

Yes. Gem Cascade accepts a tap on a gem then a neighbour, or a swipe. In portrait the score panel sits right above the board and the buttons right below; in a small frame such as a 345 by 345 embed the panel shrinks to one row. The game UI is English only.

## Examples

- Gem Cascade match-three game (scene)
- Twilight Vault (video)
