Loading recipe…
This is the same sticky-wild demo. built with the CellPin primitive instead of ghost sprites and manual grid re-injection.
Compare with the original sticky-wild recipe which tracks a stuck[] array and overlays PIXI.Sprite ghosts on the stage. This version uses reelSet.pin(). the engine handles the overlay and the countdown.
The whole mechanic
const STICKY_TURNS = 3;
reelSet.events.on('spin:allLanded', ({ symbols }) => {
for (let c = 0; c < symbols.length; c++) {
for (let r = 0; r < symbols[c].length; r++) {
if (symbols[c][r] === 'wild' && !reelSet.getPin(c, r)) {
reelSet.pin(c, r, 'wild', { turns: STICKY_TURNS });
}
}
}
});
That’s it. Nine lines. No external state, no ghost sprites, no manual grid injection.
What the primitive does for you
- Overlay. on every
setResult(), pinned cells’symbolIdreplaces whatever the server sent. The reel lands on the wild regardless of the spin’s random result. - Lifecycle.
turns: 3decrements after eachspin:allLanded. On reaching zero, the pin firespin:expiredand is removed. - Idle updates. if you pin before any spin (or between spins), the cell updates immediately.
getVisibleSymbols()reflects the pin.
Variations
turns: 'permanent'. pin lives until you callunpin(). Good for Hold & Win.turns: 'eval'. pin is valid for one spin’s evaluation; cleared at nextspin:start. Used by expanding wild and mystery reveal.- Arbitrary payload. attach
payload: { multiplier: 3 }for multiplier wild.
Related
- Expanding wild.
turns: 'eval'fill - Multiplier wild. same pattern + payload
- Sticky-win respin. pin all winners for N respins