pixi-reels
All recipes

Hold & Win: live event trace

A small board runs a full feature while every board.events beat prints to a live log — feature:enter, respin:start, cell:landed, coin:locked, respins:changed, respin:end, board:full / feature:end. Watch the lifecycle instead of imagining it.

Loading recipe…

Press Run. A four-by-three board opens with one seed coin and runs the respin loop; on the right, every board.events beat prints as it fires — colour-coded and in order. Press again to clear and run a fresh feature.

This is the companion to the Hold & Win guide: the same state machine the guide diagrams, playing out live. Watch a wave fire respin:start, then a row of cell:landed in stagger order (a few of them coin:locked), then respins:changedhit-reset when a coin landed, miss when none did — then respin:end, and finally board:full / feature:end when the board fills or the counter runs out.

The whole recipe is event listeners

The board is an ordinary HoldAndWinBuilder board. The trace adds no mechanic — it just subscribes:

board.events.on('respin:start',   ({ round, spinning }) => log(`round ${round} · ${spinning.length} spinning`));
board.events.on('cell:landed',    ({ cell, coin })      => log(`${cell.col},${cell.row} ${coin ? 'COIN' : '—'}`));
board.events.on('coin:locked',    ({ locked, capacity })=> log(`${locked}/${capacity}`));
board.events.on('respins:changed',({ value, reason })   => log(`${value} (${reason})`));
board.events.on('feature:end',    ({ rounds, full })    => log(`${rounds} rounds · ${full ? 'full' : 'no respins'}`));

Every line you see is a real payload off the real event. That is the entire integration surface — react to these and the board drives the rest.

The driver is just a loop

board.enter([{ cell: { col: 0, row: 0 }, id: 'coin', data: { value: 5 } }]);
while (true) {
  const result = await board.respin(pickHits()); // pickHits = your result source
  if (result.done) break;
}

pickHits() here is a mock that gives each free cell a small chance of landing a coin; in a real game it’s your server response. respin() resolves after the wave lands and the counter resolves, so the loop reads straight down.