The whole board spins first. Then only the middle reel respins — the rest freeze in place. Every spin hits the same two methods: spin() and setResult().
The one-liner
setResult(grid)is the truth. If a reel’s target column already matches what it’s showing, the reel has nothing to do and just holds still.
That’s the whole trick. You don’t need a “hold this reel” API. Build the target grid with the frozen columns unchanged, and the library figures it out.
async function respinReel(reelIndex: number) {
const grid: string[][] = [];
for (let r = 0; r < reelSet.reels.length; r++) {
if (r === reelIndex) {
// New target for the one reel that is respinning.
grid.push(await server.rollReel(r));
} else {
// Snapshot the visible column — the reel won't move.
const reel = reelSet.reels[r];
const col: string[] = [];
for (let row = 0; row < reel.getVisibleSymbols().length; row++) {
col.push(reel.getSymbolAt(row).symbolId);
}
grid.push(col);
}
}
const p = reelSet.spin();
reelSet.setResult(grid);
await p;
}
Why it works for stacked symbols too
A “stacked” symbol is one that fills an entire reel column in the final grid — think a wild that covers all three rows of reel 3. When you want a follow-up respin that keeps that stacked wild in place, you use the exact same code path. Put the stacked column into grid[3] and the reel doesn’t move. No special API, no flag on the reel.
// Mark the stacked reel as held and respin the rest.
grid[reelWithStack] = ['wild', 'wild', 'wild']; // snapshot of what's there
grid[otherReel] = await server.rollReel(otherReel);
Variations
- Respin-on-demand button — give the player a “respin reel 3” button that costs a fraction of the base bet.
- Auto-nudge — if
getSymbolAt(0)on a reel is the scatter symbol, silently respin the other reels to try for the remaining scatters. - Staggered hold & win — hold every locked coin, respin every free cell individually; see hold-and-win for the board-wide version.
Related recipes
- Hold & Win — the board-wide respin, where every cell is either held or respinning
- Sticky wild — wilds that stick across normal spins
- Slam-stop — letting the player end a spin early