PR pixi-reels
All recipes

Peek symbol from buffer-above

Pre-fill the buffer-above slot so a teaser symbol sits just out of frame. visible during scroll-in on the next spin.

Loading recipe…

What you’re seeing

Every reel has an extra “PEEK” symbol prefilled in the buffer-above slot. the one cell that lives just above the visible window. During the spin, that symbol scrolls through visibility before random symbols take over, giving the player a brief glimpse of “what’s queued.”

The same shape works for initialFrame (seeds the first spin) and setResult (seeds every subsequent one).

The minimum code

// Seed the buffer-above at build time. ColumnTarget is the explicit shape.
// `bufferAbove[0]` is the slot closest to the visible top row.
const initialFrame: ColumnTarget[] = [
  { visible: ['A', 'B', 'C'], bufferAbove: ['COIN'] },
  { visible: ['A', 'B', 'C'], bufferAbove: ['COIN'] },
  { visible: ['A', 'B', 'C'], bufferAbove: ['COIN'] },
];

const reelSet = new ReelSetBuilder()
  .reels(3)
  .visibleRows(3)
  .bufferSymbols(1)
  .symbols((r) => { /* ... */ })
  .ticker(app.ticker)
  .initialFrame(initialFrame)
  .build();

// Re-seed on every spin so the peek persists
const promise = reelSet.spin();
const visible = await server.spin();
reelSet.setResult(visible.map((col) => ({ visible: col, bufferAbove: ['COIN'] })));
await promise;

Indexing convention

For a reel with bufferAbove = 2 and visibleRows = 3, the explicit form maps to numeric slots like this:

ColumnTarget fieldCell
bufferAbove[1]furthest above visible
bufferAbove[0]closest above visible
visible[0]visible row 0 (top)
visible[1]visible row 1
visible[2]visible row 2 (bottom)
bufferBelow[0]closest below visible

See Buffer indexing for the full reference.

Where to go next

  • Anticipation teaser. pair buffer-above with setAnticipation so a slow reel approaches a known high-value symbol
  • Buffer indexing. the full convention reference
  • Anticipate a reel. base anticipation mechanic
  • Nudge a reel. after the spin lands, push that buffer-above symbol into view with reelSet.nudge(col, { distance: 1, direction: 'down', incoming: ['X'] })