PR pixi-reels
All recipes

Sticky wild (CellPin)

Sticky wild using the engine's CellPin primitive. no ghost sprites, no manual grid injection. Pin once on land, the engine handles the rest.

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

  1. Overlay. on every setResult(), pinned cells’ symbolId replaces whatever the server sent. The reel lands on the wild regardless of the spin’s random result.
  2. Lifecycle. turns: 3 decrements after each spin:allLanded. On reaching zero, the pin fires pin:expired and is removed.
  3. 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 call unpin(). Good for Hold & Win.
  • turns: 'eval'. pin is valid for one spin’s evaluation; cleared at next spin:start. Used by expanding wild and mystery reveal.
  • Arbitrary payload. attach payload: { multiplier: 3 } for multiplier wild.