pixi-reels
All mechanics

Mechanics

Hold & Win

Coins stick where they land and the empty cells respin until the counter runs out or the board fills.

Demos

The demos start with the smallest board and add one idea at a time. The last sections cover draw order and dimming, which most boards only need once the art is in.

The basic board#

Respin round#

Coins lock where they land and the free cells respin until the grid fills or the respins run out. The board runs the round. The coin values belong to your game.

Loading recipe…

Event trace#

A board plays a whole feature while each board.events event prints to a log as it fires. Use it to see the order of the round before you hook your HUD and sounds onto it.

Loading recipe…

Sprite coins#

The board built from TexturePacker sprites, with no Spine runtime. The numbers blur while they spin and each coin plays a 30-frame flip when it lands.

Loading recipe…

Spine coins#

The board with production Spine coins. MINI and MAJOR tiers reveal on lock, plaques sit beside the grid, and the collect flies the coins into a counter.

Jackpot coins (MINI and MAJOR) are placed by the server only. Their weight is 0, so they never come up on a random strip.

Loading recipe…

Coin values#

Value in the symbol class#

A ReelSymbol written from scratch that draws a coin with a number on it. The value is read back off the landed symbol. Start here if you have not written a symbol class before.

Loading recipe…

Value in the coin data#

The same coin, with the number kept in data instead of the class. One generic coin then carries whatever value the server sends, and the number is painted from coin:locked.

Loading recipe…

Number on existing art#

When the coin art already exists as a sprite, keep it and add the number on top as a second child of the symbol’s view.

Loading recipe…

Coefficient values#

Each coin carries a coefficient between x2 and x50 in coin.data. The board locks the hits and respins only the free cells. The total is summed from board.lockedCoins.

Loading recipe…

Count-up coin#

Each coin’s amount counts up from 0.00 to its value as it settles. The coins start in reading order, so the count runs across the board as a wave.

Loading recipe…

Mystery value#

Coins land blank. On lock, a strip of candidate amounts spins inside the coin face and slows down onto the real value.

Loading recipe…

Upgrade in place#

A held coin steps up the value ladder (5, 10, 25, 50, 100) with a flip and a pop. Nothing respins and no cell moves.

Loading recipe…

Swap to a jackpot tier#

board.setSymbolAt(cell, id, data) puts a different symbol in one cell and rewrites that cell’s entry in the board’s ledger. Here a coin turns into MINI, then MAJOR, and the neighbouring coins stay where they are.

Loading recipe…

Badge that survives a swap#

An x100 badge is stored in coin.data and attached as a child of the symbol’s view. Because it is rebuilt from the data, it comes back after an in-place swap and travels with the coin on a collect flight.

Loading recipe…

Collectors and special coins#

Collector#

When the collector orb locks, the game walks board.lockedCoins, flies the values of the orb’s neighbours into it and calls release() on those cells.

Loading recipe…

Collector with flights#

A collector orb lands and pulls a copy of each coin’s value along a bezier arc, adding to its total as each one arrives.

Loading recipe…

Collector with particles#

The same collect, with a stream of particles trailing each value into the orb.

Loading recipe…

Fly to a meter#

On collect, each coin’s value flies into a meter above the reels. The meter adds up the total and fills a bar toward a target.

Loading recipe…

Payer coin#

A payer orb lands and adds its value to each of the other coins. Changing one line turns it into a doubler.

The payer is placed by the server only. Its weight is 0, so it never comes up on a random strip.

Loading recipe…

Multiplier coin#

A multiplier coin lands, a strike effect plays, an xN badge pops and each coin’s value is multiplied.

Loading recipe…

Row jackpot#

When a coin completes a row, the row flashes coin by coin, the MINI plaque lights and the row total flies into it.

Loading recipe…

Bonus cells#

Some cells are marked as bonus cells from the start. A coin that lands on one lights the cell and doubles its value.

Loading recipe…

Entering the feature#

From the base game#

A normal 5x3 spin that drops into the Hold & Win board when 3 BONUS symbols land, in the same chain, and switches back on feature:end.

Loading recipe…

Feature mode by middleware#

This one does not use the board. It switches a plain ReelSet into a bonus mode at runtime by adding a frame middleware, and back by removing it, with no rebuild. In the bonus mode the middleware turns some visible cells into WILD.

Give your middleware a priority above 10, the priority of target placement, so it runs after the server’s grid is placed and can react to it. The recipe uses 20.

Loading recipe…

Pacing the wave#

Last-cell anticipation#

The anticipateWhen builder option slows the last spinning cell to a tension profile, for the moment when one more coin would fill the board.

Loading recipe…

Skip#

board.skip() puts each spinning cell at its landed position and fires feature:skip. feature:end is still the one event that says the feature is over.

Loading recipe…

Quicken#

board.skip({ mode: 'quicken' }) lands each spinning cell through its stop instead of placing it. The board’s stagger lives in each cell’s minimum spin time, so dropping it lands the whole wave together, and each cell still spins its symbol in and bounces. Add speed: 'turbo' to land the wave on the turbo profile, or call HoldAndWinBuilder.skipMode('quicken') to make quicken the default. feature:skip reports the count and the mode, and the landing events fire as usual.

Loading recipe…

One speed switch#

speeds(normal, turbo, superTurbo) registers each profile in each cell’s SpeedManager, and board.setSpeed(name) switches them all at once, the board’s version of reelSet.setSpeed(). A wave already in flight finishes on its own profile, so a turbo press in the middle of a wave is setSpeed plus skip(). The landing wave steps by each profile’s stopDelay (70, 25 and 0 ms here), so it tightens as the speed goes up and lands in one go on superTurbo, without a stagger function.

Loading recipe…

One cell at a time#

board.reelAt(cell) returns the cell’s own 1x1 ReelSet. You can start it, slam-stop it and read the symbol in it without touching the other cells. Use this when a feature needs a cell to move outside the normal wave.

Loading recipe…

A clover game#

These demos use the art of one real game, where the coins are clovers. Each clover is a Spine 4.2 skeleton.

Base game into the feature#

A fruit base game. Gold clovers show bet-scaled money as they spin past, and the collect, multi, mystery and super clovers carry no amount. Three or more clovers on the stop hand their cells to the Hold & Win board.

Loading recipe…

Bonus board#

The feature on its own. Gold clovers lock with their amounts, the blank cells are the game’s dark clover tile, and the 1 2 3 lamps below are the respin counter.

Loading recipe…

Respin counter#

Three lamps driven by respins:changed alone. Its reason says whether the count changed on seed, hit-reset or miss, so the lamps light or dim without the game working the count out again.

Loading recipe…

Feature clovers#

Clovers without an amount act on the held gold between waves. MULTI doubles each amount, MYSTERY becomes a gold clover with a revealed amount through setSymbolAt, and COLLECT adds the board up onto its own face.

Loading recipe…

Lightning collect#

Held clovers idle until the feature ends. When COLLECT locks, lightning strikes from it to each gold clover’s number and the collect face counts the values into its own. The gold clovers keep their values, and the spent collector turns grey and stays held.

Loading recipe…

Mystery jackpot capsule#

The sealed capsule locks like a coin. Between waves the jackpot titles flick across its face through setBadge and stop on the tier the server sent. Then the plaque lights and the amount appears.

Loading recipe…

Lock animation#

Landing only#

lockAnimation('landing') plays the landing settle on each lock and nothing more. board.playWin() is the single celebration, called when the game decides.

Loading recipe…

Per coin#

lockAnimation can be a function of the coin that locked. Here gold clovers settle with their landing only and COLLECT also celebrates. The celebration waits for the skeleton’s own landing beat (symbol.landing) instead of replacing its track, so the landing plays first and the win follows. The HUD prints when each one finishes.

Loading recipe…

Board size and cell shape#

Rectangular cells#

Hold & Win art is usually wider than it is tall. cellSize takes a width and a height, plus a columnGap and a rowGap, so the board lays out to the art’s own rectangle and the game’s grid shows through the gaps. The clovers are the Spine 4.2 skeletons from the clover game, with idle, landing, win and blur tracks that the engine plays through SpineReelSymbol.

Loading recipe…

5x5 board#

The clover board with five rows, all cells live from the start.

Loading recipe…

Growing board#

Built 5x5 with the top and bottom rows inactive behind a purple sealed tile. Holding enough clovers opens a row with board.activate(), and the next respin spins it too.

Loading recipe…

Background grid#

Real gaps between the cells (columnGap and rowGap) and no cell chrome, so the background shows through. Behind the board is a gradient panel and one rounded frame per cell, drawn with plain PIXI.Graphics on each cell’s exact bounds. A rounded cell mask cuts the tiles’ corners to match.

Loading recipe…

Rounded outer corners#

Each cell has its own mask. cellMask takes a function that is called once per cell with its column, its row and the board size, and returns that cell’s mask strategy. Here the cells clip to a plain rectangle, except the four corner cells, which each round their one outer corner through RoundedRectMaskStrategy({ radius, corners }). With no gap, the fifteen masks read as one rounded window with the panel’s radius. The info argument also carries corners, that same per-cell object worked out for you.

Loading recipe…

Blur while spinning#

Each skeleton has a blur animation that swaps its body to a motion-blur frame, and SpineReelSymbol plays it while the reel moves. The two rows are identical except that the second one opts out of the blur track.

Loading recipe…

Travel direction#

Sideways#

The round on .axis('horizontal'). Each cell is its own 1x1 ReelSet, so the axis only decides which edge a coin scrolls in from. The board still lays out columns by rows, and a lock still claims one cell.

Don’t build this on a plain ReelSet with .orientation('horizontal'). There a reel is a whole row, so the row moves as one strip across the gaps and past the cells that should be locked.

Loading recipe…

Upward#

The round on .axis('vertical', 'reverse'). It also shows the hold that goes with it. respin() spins board.freeCells and nothing else, and respin:start reports which cells are in flight.

On a ReelSet the equivalent is spin({ holdReels }), which holds a whole reel. A board has no holdReels because Hold & Win holds single cells.

Loading recipe…

Draw order and dimming#

Cell draw order#

Each cell is its own reel set, so the clovers the engine lifts above the cells at rest share one layer, drawn in attach order. That order is column by column, which lets the next column’s clover cover a lower clover’s glow. cellZIndex sorts the layer by whatever the board returns, here lower rows in front and the capsule above everything, and the board asks again on each place and landing.

Loading recipe…

Lift one cell#

cellZIndex is the order at rest, and the board asks for it again on each place and landing. A clover that must stay on top while it upgrades can’t get there by returning a bigger number, because the next landing overwrites it during the animation. board.lift(cell) raises the cell on a separate channel and returns a release function. The refresh keeps running underneath without touching the lifted cell, and the release puts the cell back without recomputing anything.

Loading recipe…

Lift and dim#

board.dim({ except }) goes with lift(). The dim draws above the clovers and below anything lifted, so a lifted cell stays in front of it whether or not it is in except. A dim covers cells, not symbol ids, so this collect works out which cells hold the gold clovers it is about to sweep and spares them. The money stays bright and the blanks go dark. The dim fades in and out over fade ms off the board’s own ticker, and fade: 0 cuts.

Loading recipe…

Dim the cell or the art#

There are two ways to push a board back. dim() lays a rectangle over each cell, so the clover goes dark along with the tile it sits in. dimSymbols() tints each symbol towards black instead, so the art sinks and the board stays lit. The same sweep runs twice in the demo, once with each. amount sets the strength on both, and both fade over fade.

This is a board method rather than a few lines of gsap.to because a dimmed cell that swaps its symbol has to keep its dim, and the symbol that left has to lose its tint before the pool gives it to another cell.

Loading recipe…

Dimming one cell up close#

One cell, scaled up, holding a fruit instead of a clover so the cell’s background shows all around the symbol. The blue plate is drawn by cellChrome() on the board, not by a symbol, so dimSymbols() never touches it. amount steps through 0.3, 0.6 and 0.9 and the plate stays the same. Then the same 0.6 through dim() takes the whole cell down.

In the last step the cell is swapped to the empty id. There is no art left to dim, so dimSymbols() changes nothing, neither the symbol that has gone nor the plate.

Watch for this on a real board. If your blank tile is a registered symbol, as the dark tile is in the clover demos (the empty id), it is art and dimSymbols() dims it too. Draw anything that must stay lit in cellChrome(), or name its cell in except.

Loading recipe…

Concept

Hold & Win
How a Hold & Win round runs, and how to drive the board from your game client.

Hold & Win, also sold as Lock & Respin or Hold & Spin, is a feature where coins land, stick, and refill a respin counter until the board fills or the respins run out. pixi-reels ships it as a built-in board:

import { HoldAndWinBuilder } from 'pixi-reels';

The demos above each show one technique. This part explains how the board works as a whole and how a game client drives it.

How the board is built#

A Hold & Win board is a grid of cells that spin independently. The engine spins in columns, each a ReelSet, but the mechanic works in cells. So each cell is its own 1x1 reel set, and HoldAndWinBuilder lays out the grid and runs the round across them.

The board does not know what a coin is worth. A coin is an opaque record:

{ cell: { reel, cell }, id: 'coin', data: /* anything you want */ }

The id picks the registered symbol art. The data belongs to you and can hold values, jackpot tiers, multipliers or collector flags. The board never reads it. Adders, doublers, collectors and flights to a meter are game logic you write on top of the board, using these:

APIWhat it gives you
board.eventseach step of the round, with the coin payload
board.symbolAt(cell)the live symbol instance, so you can call your own symbol’s methods
board.cellCenter(cell) / board.cellBounds(cell)exact pixel geometry for flights and trails

With that split, a new Hold & Win variant is mostly game code and the board stays the same.

The round#

The board is a three-state machine. board.phase reports where it is: 'idle', 'active' or 'spinning'.

idle
enter(seed)
active
respin(hits)
spinning
cells land
active
respins left, board not full
spinning
board fills OR respins hit 0
feature:end
idle
  1. enter(seed) seeds the board with the trigger coins. They lock at once, without a spin, and the respin counter arms. The board goes from idle to active.
  2. respin(hits) spins each free cell. The cells named in hits land their coins and the others land blank. The board goes from active to spinning and back. If a coin landed in this wave the counter resets to full. If nothing landed it goes down by one.
  3. The feature ends when the board fills or the counter reaches zero, and the board returns to idle. Then you collect.

Events in one respin#

Events come in a fixed order. Cells land in stagger order, so the landing and lock events arrive one at a time:

respin(hits)
  • respin:start
    • cell:landedper cell, in landing order (coin = null on a miss)
    • coin:lockedonly on a hit; the board plays the lock animation ('win' by default)
  • respins:changedreason: 'hit-reset' (full) or 'miss' (-1)
  • respin:end
  • [board:full]if the last free cell just locked
  • [feature:end]if full, or the counter reached 0; phase returns to idle

Driving it from your game client#

The board runs the animation of each round. You own the loop and the source of results, which can be an RGS, a mock server or an RNG. The driver is short:

const board = new HoldAndWinBuilder<{ value: number }>()
  .grid(5, 3)
  .cellSize(72, { gap: 4 })
  .symbols((r) => r.register('coin', CoinSymbol, COIN_OPTS))
  .weights({ coin: 1, empty: 4 })   // how often coins flash past during the spin
  .respins(3)
  .ticker(app.ticker)               // required: drives every cell's reel
  .build();

app.stage.addChild(board.container);

// React to the round however your game presents it: HUD, sounds, flights.
board.events.on('coin:locked', ({ coin, locked, capacity }) => {
  hud.total += coin.data?.value ?? 0;     // you own the value; the board does not
  hud.text = `${locked} / ${capacity}`;
});

// 1. trigger
board.enter(await server.triggerCoins());

// 2. the respin loop: one round per iteration, you pace it
while (true) {
  const round = await server.nextRound(board.freeCells);   // your result source
  const result = await board.respin(round.hits);           // the board animates the wave
  if (result.done) break;                                  // full or out of respins
  // anything between rounds (celebrate, delay, play a teaser) happens here
}

// 3. collect: release the coins and fly them wherever you like
for (const coin of board.lockedCoins) flyToMeter(board.cellCenter(coin.cell), coin.data?.value ?? 0);
board.release(board.lockedCoins.map((c) => c.cell));

respin() resolves only after the whole wave has landed and the counter has been updated, so the loop reads top to bottom.

For a skip button, call board.skip(). It slams each cell that is still spinning. The landing, lock and feature-end events still fire, so the rest of your code does not change. The quicken form, board.skip({ mode: 'quicken' }), lands the cells instead of cutting them. Each spinning cell drops its minimum spin time, so the wave lands together, and each cell still spins its symbol in and bounces. Add speed: 'turbo' to land it on turbo, or make quicken the board’s default with skipMode('quicken') on the builder.

Events#

Each event carries your TData on its coins.

EventPayloadFires when
feature:enter{ seed, respins }enter() seeds the board
respin:start{ round, respinsLeft, spinning }a wave begins
cell:landed{ cell, coin } (coin: null on a miss)each cell settles, in stagger order
coin:locked{ coin, locked, capacity }a hit cell locks
cells:activated{ cells, capacity }activate() woke dormant cells; capacity is the new full-board count
speed:changed{ name, previous }setSpeed() moved every cell to another profile
respins:changed{ value, reason }the counter changed (seed, hit-reset or miss)
respin:end{ round, hits, respinsLeft }the wave finishes
board:full{ coins }the last free cell locks
feature:end{ coins, rounds, full }the feature is over and the board is idle
coin:released{ coin, remaining }release() removed a coin (the collect moment)
feature:reset{ clearedCoins }reset() hard-cleared the board
feature:skip{ inFlight, mode, speed?, payload? }skip() freed the in-flight cells, placed ('slam') or landing through their stop ('quicken'). speed and payload are the press’s options as given

release() means “collect this coin” and fires coin:released once per coin. reset() is a hard clear back to idle and fires a single feature:reset, so a HUD that counts down on collect does not tick on a reset.

setSymbolAt(cell, id, data) rewrites a locked coin in place, for example a coin becoming MINI and then MAJOR, and keeps the board’s ledger correct. It throws on a free cell. New tracked coins are placed only by enter and respin.

Other builder options#

Production boards often need more than the square default. These builder options cover cell shape, the lock animation and cells that start outside the feature:

const board = new HoldAndWinBuilder()
  .grid(5, 3)
  // art is 202x170: a seam between columns, rows touching
  .cellSize({ width: 101, height: 85 }, { columnGap: 6, rowGap: 0 })
  // 'win' (default) plays playWin() on every lock; 'landing' plays the
  // symbol's playLanding() settle instead; 'none' plays nothing
  .lockAnimation('landing')
  // built, drawn as `sealed`, but outside the feature until activate()
  .inactive(row(0).concat(row(4)), 'sealed')
  ...

With 'landing' or 'none' the celebration is up to you. await board.playWin() pulses each locked coin, and board.playWin(cells) pulses a subset. Call it when the game decides, usually on board:full or after feature:end.

Some coins start their own landing beat when they land, such as a Spine coin with autoPlayLanding or a sprite that reports its settle through trackLanding. They keep it. 'win' waits for that beat before the celebration, and 'landing' does not play it a second time. The mode can also be a function of the coin that locked, so a collector celebrates while plain coins only settle:

.lockAnimation((coin) => coin.id === 'collector' ? 'win' : 'landing')

board.activate(cells) wakes dormant cells between waves. They show the empty symbol, join the next respin and count toward isFull from then on. reset() seals them again. The rectangular cells, landing only and growing board demos above show each of these.

Draw order between cells#

Each cell is its own reel set, so a coin’s zIndex only sorts it against its own cell’s buffers. Art that the engine lifts above a cell’s mask at rest (unmask: true) renders in one layer above all cells, in attach order, which is column by column. As a result the next column covers the overflow of a lower coin. cellZIndex makes that layer sortable, and the board asks it for each cell’s order on each place and landing:

.cellZIndex(({ cell, symbolId, cols }) =>
  (symbolId === 'grand' ? 1000 : 0) + cell.cell * cols + cell.reel)

board.liftedLayer is that layer, for an effect that has to sit between the cells and their lifted art. symbolZIndex(resolver) is the per-symbol form from ReelSetBuilder, applied inside each cell. See big symbols.

Speeds#

Each cell is its own reel set with its own SpeedManager. The board registers speeds in all of them and switches all of them together:

const board = new HoldAndWinBuilder()
  .speeds({ normal: NORMAL, turbo: TURBO, superTurbo: SUPER_TURBO })
  ...
board.setSpeed('turbo');            // every cell, at once; fires speed:changed
board.addSpeed('cinematic', slow);  // one more, after build

Cells land in a diagonal wave, and the wave’s step is the active profile’s stopDelay. On a reel set that value is the time between reels stopping. On a board it is the time between steps of the wave. Each cell spins (reel + cell) * stopDelay ms on top of the profile’s minimumSpinTime, so NORMAL’s 140 ms steps the wave and TURBO’s 0 lands all cells together. .stagger(fn) replaces the shape of the wave. It receives the speed’s name and profile:

.stagger((reel, cell, speed, profile) => reel * profile.stopDelay) // column by column
.stagger((reel) => reel * 120)                                     // fixed, whatever the speed

The rule is the same as for reelSet.setSpeed(). A cell already in flight finishes on the profile it started with, and the next wave runs on the new one. To cut a wave in progress on a turbo press, call board.skip(). To land it on turbo instead, call board.skip({ mode: 'quicken', speed: 'turbo' }). Each speed name also gets a name:tension variant that the board uses for an anticipating wave.

When the board does not fit#

pixi-reels ships boards in two layers:

  • BoardGrid is the primitive. It is a grid of cells that each spin independently. It knows geometry, instances and spinning, and nothing about coins, locks, respins or value.
  • HoldAndWinBoard is one board built entirely on the primitive’s public API. It adds the rules for locking, respins and collecting.

If the built-in board does not do what your game needs, these are the options, from least to most work:

  1. Configure it. Stagger, respins, weights, anticipation and cell chrome are all builder options. Most games stop here.
  2. Build on the primitive. If your feature is not lock and respin at all, for example pick and reveal, cluster collect or a scratch card, skip HoldAndWinBuilder and use BoardGrid directly. The board grid reveal demo is a board on the primitive that is not Hold & Win.
  3. Fork the board. For lock and respin with different rules, copy HoldAndWinBoard and HoldAndWinState into your project and point their imports at pixi-reels. Everything they use (BoardGrid, EventEmitter, the Hw* types, cellKey, HwEffect) is public API, so the copy stays on supported ground. Then rewrite the reducer. The rule that a hit resets the respins and the rule that a full board ends the feature both live in HoldAndWinState.

The board never reads your data and has no paytable. What a coin means is decided in your code, and the board only moves the reels.

Where to go next#

API

Every exported name the concept, the demos and their sources use, with the one-line summary from the generated reference.

  • Symbol implementation using PixiJS AnimatedSprite. Swaps frame arrays on activate. Win animation plays the full sequence.

  • A grid of cells that each spin independently - the generic "board of reels" primitive. Every cell is its own 1×1 ReelSet, so it inherits the engine's phases…

  • A ReelSymbol that renders nothing and never animates.

  • Typed event emitter with zero dependencies.

  • Builds symbol frames using a middleware pipeline.

  • A Hold & Win board: a grid of independently spinning cells plus the round choreography every H&W game repeats - spin the free cells, lock the hits…

  • Fluent builder for HoldAndWinBoard.

  • The pure Hold & Win state machine - the single source of truth for board state, with zero PixiJS. It owns the locked-coin ledger, the respin counter, the…

  • The PhaseCardSymbol class in the pixi-reels API.

  • ReelSetclass

    The whole slot board as one object.

  • The configurator you call before every reel set.

  • Rounded-corner rectangles, per reel or per set.

  • The tempo of your reels, as named presets.

  • ReelSymbol implementation using Spine 2D skeletons.

  • Per-symbolId cache of "spin textures". flat snapshots a reel shows instead of the live symbol (Spine skeleton, animated sprite, ...) while it spins.

  • Wraps any ReelSymbol and swaps it for a cached snapshot texture while the reel spins. "spin static, not Spine."

  • cellKeyfunction

    reel,cell string key for the board's cell-indexed maps.

  • stepfunction

    Build a PhaseStep.

  • BoardCellinterface

    A cell coordinate in the grid.

  • One line of a DebugPlaque.

  • Middleware that participates in frame building.

  • HwCellinterface

    Grid coordinate of a board cell.

  • HwCoininterface

    A coin somewhere on the board. id selects the registered symbol art; data is an opaque game-layer payload the board never interprets.

  • Wininterface

    One "win" as the presenter sees it: an ordered set of cells to highlight.

  • Orders the cells' lifted art. See the cellZIndex option of BoardGridOptions.

  • One state-change the reducer (HoldAndWinState) decided, ready for the driver to emit. A tagged pair of { type, payload } for every board event the reducer…

  • Standard high-card deck for prototyping. Each card has its own color so a full grid is visually unambiguous at a glance.

  • Built-in speed profiles covering common slot game needs.

  • A pale-yellow WILD card for sticky/expanding-wild prototypes.

Questions

From the FAQ, the questions tagged with this mechanic. Open one here, or follow it to its own page.

How do I make a symbol from a sprite-sheet animation?open

Use AnimatedSpriteSymbol with { frames: Record<id, Texture[]>, animationSpeed }; the board calls playWin() to play the sequence.

Question page
How do I swap a symbol to a blurred texture while spinning?open

Use the shared BlurSpriteSymbol ({ textures, blurTextures }); subclass it to swap on the engine's onReelSpinStart / onReelLanded hooks so blur needs no per-cell event wiring.

Question page
How do I attach custom data (a value, a tier) to a symbol instance?open

Pass per-instance data through the symbol's constructor options, or carry it in a pin payload via reelSet.pin(col, row, id, { payload }).

Question page
How do I hold some reels still while the others spin?open

Pass reelSet.spin({ holdReels: [0, 4] }). Held reels skip START / SPIN / STOP entirely, do not move, and count as already-landed for the all-landed resolver.

Question page
How do I respin just one reel?open

Hold the rest: reelSet.spin({ holdReels: [everything but one] }). For a fully self-contained single reel, the Hold & Win pattern uses one 1x1 ReelSet per cell.

Question page
How do I anticipate the final cell when one more coin means the grand?open

In Hold & Win, flip the remaining cells to a tension profile with the builder's anticipateWhen(({ locked, capacity }) => capacity - locked === 1).

Question page
How do I run built-in anticipation on a single cell, the way the engine does it for a whole reel?open

Hold & Win cells are independent reels, so the builder's anticipateWhen(...) runs anticipation on the still-spinning cells out of the box; for one cell, swap that mini-reel to a tension profile.

Question page
How do I build a Hold & Win board where each cell spins on its own?open

A Hold & Win cell is its own 1x1 ReelSet. The engine's atomic spin unit is the reel, the mechanic's is the cell. HoldAndWinBuilder (in pixi-reels) builds the whole grid of independent cells plus the lock / respin choreography. Import it and drive it with enter() then respin() per round.

Question page
How do I lock a coin in place when it lands?open

Stop spinning that cell and leave its symbol in place. With HoldAndWinBuilder a hit cell is not respun next round; the coin:locked event fires so you can play the lock animation and update the HUD.

Question page
How do I respin only the empty cells?open

board.respin(hits) spins only the free cells; the locked ones sit out automatically.

Question page
How do I reset the respin counter to 3 on every new coin?open

The builder's .respins(3) sets the count, and every locked coin resets it (the respins:changed reason is 'hit-reset').

Question page
How do I decrement the respin counter on a dry spin?open

A respin with no hits decrements the counter automatically (respins:changed reason 'miss').

Question page
How do I end the feature when the board is full (grand jackpot)?open

board.respin(...) returns { full, done } and fires board:full when every cell is locked.

Question page
How do I carry the triggering coins into the feature already locked?open

board.enter(seedCoins) seeds them already locked and fills the respin counter.

Question page
How do I show the held count and respins left in a HUD?open

Read board.lockedCoins.length / board.respinsLeft (or the coin:locked / respins:changed events) into your HUD.

Question page
How do I make most spins land blank so coins flash by rarely?open

Weight empty heavily over the coin on the strip, e.g. .weights({ coin: 1, empty: 3 }).

Question page
How do I drive the whole feature from server-decided hits per round?open

Loop await board.respin(round.hits) per round with the server's hit list until result.done.

Question page
How do I do a column-respin variant (hold whole columns)?open

For whole-column holds use one ReelSet and spin({ holdReels }) instead of the per-cell board.

Question page
How do I switch from base game into the Hold & Win board cleanly?open

Hide the base ReelSet and show the HoldAndWinBoard.container. Same screen, two display objects; enter(triggerCoins) carries the trigger into the feature, and feature:end is when you swap back.

Question page
How do I play a slick reset back to the opening state after the feature?open

On replay, board.reset() blanks the board, then re-enter(seed); animate the sweep yourself.

Question page
How do I gate the next respin until all land animations have settled?open

Collect each lock effect's promise and await Promise.all(...) before the next board.respin(...).

Question page
How do I award a mini jackpot when a whole row of coins fills?open

Check the locked cells for a full row in your coin:locked handler, flash the row and award the mini jackpot in the game layer.

Question page
How do I grow the board by a row when a trigger condition is met mid-feature?open

Live row growth is not built into the board; rebuild it at the new size, or pre-size it and reveal a row on the trigger.

Question page
How do I make a special coin upgrade all adjacent coins when it lands?open

On coin:locked, walk the other coins and bump their ids/data. The board hands you symbolAt(cell) and the coin payload.

Question page
How do I persist the locked board if the player reloads mid-feature?open

Store the locked coins server-side and replay them into board.enter(...) on reload.

Question page
How do I run several Hold & Win boards at different bet tiers from one builder?open

One HoldAndWinBuilder builds a board per tier. Call .build() with different .respins / weights, or rebuild per bet.

Question page
How do I drive each Hold & Win cell as its own reel, start it, stop it, and read the symbol inside it independently?open

Each cell is its own 1x1 ReelSet: board.reelAt(cell) hands you the reel to spin() / skipSpin() it on its own, and board.symbolAt(cell) reads the live symbol inside it.

Question page
How do I make a single skip fast-forward every spin, flight and collect at once, then fire one "feature done" event?open

board.skip() slams every in-flight cell to its landed position and fires feature:skip; gate your own flights / collect on that signal to cut them short, and treat feature:end as the single "all done" event.

Question page
How do I print a money value on a coin?open

Use the shared CoinSymbol with coinValue(amount) (or your own text) to render the amount on the coin face.

Question page
How do I format the value as 0.00 with a bitmap gold font?open

Render the amount with a PixiJS BitmapText in a gold digit font and format it with value.toFixed(2).

Question page
How do I scale the number to fit the coin face?open

Fit the text by font size to a fraction of the coin width, so short values read big and long ones shrink.

Question page
How do I attach the value as data without baking it into the id?open

Carry the value in coin.data (the HwCoin payload) or a pin payload, the id stays art-only.

Question page
My coin is a mystery. How do I spin values inside it to reveal the number it held?open

Land the coin showing a mystery face, then on lock spin a strip of candidate values inside the coin and ease it onto the real amount. Drive it from the coin:locked event via symbolAt(cell) so the board itself stays value-agnostic.

Question page
How do I land a coin wearing a MINI/MAJOR word and reveal it into a money face?open

Land the coin showing the tier word, then on coin:locked play the reveal animation that spins it and settles on the money face.

Question page
How do I show MINI/MINOR/MAJOR/GRAND jackpot plaques above the reels?open

The plaques are game-layer UI. Render them above the board and flash them on coin:locked by coin.data?.kind, type the board as HoldAndWinBuilder<{ kind: string }> so the payload is typed, since data is optional.

Question page
How do I flash the matching jackpot plaque when its coin locks?open

In the coin:locked handler read coin.data?.kind (data is optional) and play that plaque's win animation.

Question page
How do I sum every coin value at the end and count it up?open

On feature:end, sum the board.lockedCoins data values and roll the total up in your counter.

Question page
How do I make a collector coin pull every other coin's value into itself?open

The collector is just another server-placed id. When it locks, walk the locked coins and fly a clone of each value into the collector along a bezier arc (bezierFly), ticking the collector's total up on every arrival. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I fly a value clone from each coin into the collector over an arc?open

Spawn a clone at board.cellCenter(coin.cell) and bezierFly(clone, from, to, { lean: 'up' }) into the collector. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I tick the collector total up as each value lands on it?open

Increment the collector total in the bezierFly().then(...) arrival callback. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I make a payer coin add its value to every other coin?open

On its lock, iterate board.lockedCoins and bump each value in your game state, flying a token to each coin. The board stays value-agnostic.

Question page
How do I make a coin double or boost every value already on the board?open

Same pattern: walk the locked coins and rewrite their values on lock (e.g. value *= 2), then refresh the labels from your data.

Question page
How do I make a row/column of cells all act as collectors that sweep the board?open

Use the shared coinWaves(coins, 'by-cell' | 'by-reel') helper (copy it from packages/kit/src/holdAndWinFx.ts) to order the sweep, and bezierFly each value into the collector cell, optionally trailed by particle streams.

Question page
How do I upgrade a coin's value tier in place (5, 10, 25)?open

Swap the coin's id and data in place with board.setSymbolAt(cell, id, data). It rewrites the ledger entry and returns the new live symbol, so lockedCoins stays correct; repaint the label from the new data. It throws on a free cell, and while a wave is in flight. Call await respin() first. On a plain ReelSet the equivalent is reelSet.setSymbolAt(reel, cell, symbolId), which carries no payload.

Question page
How do I send collected coins flying to a feature meter above the reels?open

board.cellCenter(cell) gives the start; bezierFly to your meter's screen position with arriveScale to shrink it in. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I send a golden trail to the meter instead of a flying coin?open

Send a trail sprite or particle along the same bezierFly path instead of a coin clone. The board only hands out geometry. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I show a coin counting up its own value before locking?open

Tween a { v } counter from 0 to the value in your cell:landed / coin:locked handler, rewriting the label every frame, then pop the fitted final amount in.

Question page
How do I make a blank coin reveal a random value with a spinning reel inside it?open

Land it blank, then scroll a masked strip of candidate values inside the coin and ease it onto the revealed number, driven from coin:locked.

Question page
How do I order the collect flights by row, by column, or all at once?open

The shared coinWaves(board.lockedCoins, 'by-reel') helper, also 'by-cell', 'sequence', 'all', { chunk }, or a custom (item, index) => waveIndex, groups the flights into waves. It lives in packages/kit/src/holdAndWinFx.ts, not the package.

Question page
How do I curve the collect flight toward the screen edge or center?open

bezierFly(..., { lean: 'up' | 'down' | 'in' | 'out', curvature }) bends the arc; around sets the in/out reference point. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I aim collect flights at a specific feature meter with a custom path?open

Pass an explicit control point to bezierFly (computed per coin index) to aim the flight at a specific feature meter. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I attach a value overlay (100x, a jackpot label) that survives an in-place symbol swap and rides along when the symbol flies?open

Keep the value in coin.data and attach the overlay as a child of the symbol's view; on an in-place swap re-attach it from data (the new instance has a fresh view), and on a flight rebuild it onto the flying clone from the same data.

Question page
How do I freeze a Spine animation on its final frame and hold it?open

Park the one-shot just before its end with timeScale = 0 so it never completes and holds the last frame. The shared freezeAtEnd helper does exactly this.

Question page
How do I play an arbitrary named Spine animation on a symbol?open

await symbol.playOneShot(name) plays it once on SpineReelSymbol and resolves when it ends, then returns the track to idle; pass { track: 1 } for an overlay (cleared after) or { then: 'hold' } to keep the last frame. For a loop, symbol.playOnTrack(track, name, true), or reach the skeleton via the .spine getter.

Question page
How do I make a symbol react to a neighbour (e.g. shake when hit)?open

On the triggering event (e.g. coin:locked or a win), call a method on the neighbour symbol's view to shake it.

Question page
How do I throw a coin symbol at a character (a pig) above the reels?open

Read the source cell center with board.cellCenter(cell) and the character's position, then tween a coin clone along a bezier arc with bezierFly(clone, from, to, { lean: 'up' }), the flying object is the first argument. Play the character's reaction on arrival. The flight is game-layer choreography; the board only hands out pixel geometry and events. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I make the character react (chomp, bounce) when a coin hits it?open

Resolve the bezierFly promise on arrival and play the character's reaction in the .then(...). Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I make a fisherman collect every money-fish on the board?open

On collect, walk the money-symbol cells and bezierFly each value into the character; the board only gives you cellCenter + the payloads. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I fly each collected symbol's value into the character's pouch and total it?open

bezierFly the value clone to the character's position and add it to your running total in the arrival callback. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I have a special symbol shoot/affect another cell (sniper style)?open

Read both cells' geometry from getCellBounds, fly an effect between them, and swap the target via setSymbolAt or a pin.

Question page
How do I make persistent feature symbols interact across the board (Money-Train style)?open

On the Hold & Win board, coordinate persistent feature symbols from your lock handler. Walk board.lockedCoins, read each via symbolAt(cell), and act across cells (absorb, boost, move).

Question page
How do I aim a flight at a moving target (the character animates while a coin flies)?open

The helper tweens to a fixed point, so recompute the target each frame in your own update (or re-issue bezierFly) as the character moves. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I sequence many throws so they arrive one after another?open

coinWaves(items, 'sequence') plus a per-item delay on bezierFly stagger the throws to arrive one after another. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I have the character grow/level up as it eats more coins?open

Scale the character's view up per collected coin in your collect callback. It is game-layer state.

Question page
How do I require 6+ coins to trigger Hold & Win?open

Count the coin symbols in the result and call board.enter(...) when the count meets your threshold.

Question page
How do I make a symbol that is both a coin and a bonus trigger?open

Use one id and treat it as both. Your trigger logic counts it, and it also lands as a coin in the board's seed.

Question page
How do I show the scatters collecting into a trigger counter?open

On each scatter land, bezierFly it to your trigger counter and bump the count. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I animate a value flying into the meter and bumping it up?open

bezierFly the value to the meter's screen position with arriveScale and bump it in the arrival callback. Those helpers are demo code in packages/kit/src/holdAndWinFx.ts, not exports of the pixi-reels package, copy them into your project.

Question page
How do I drive a progressive jackpot value that ticks up live?open

A progressive value comes from your server feed; animate the ticking number in your UI.

Question page
How do I show a coin-collect counter that aggregates bonus coins?open

Aggregate collected coins in your state via coin:locked / collect callbacks and show the total.

Question page
How do I play a per-coin sound as each one lands in stagger order?open

Play it in the cell:landed / coin:locked handler. They fire in landing (stagger) order.

Question page
How do I sync a sound exactly to a Spine animation event?open

Add a Spine animation event and play the sound from the skeleton's event listener via the .spine getter.

Question page
How do I overlay a HUD that reads purely from board events?open

Subscribe your HUD to the typed reelSet.events / board.events. They are the single source of truth.

Question page
How do I show a "respins left" badge that updates live?open

Bind it to the respins:changed event / board.respinsLeft.

Question page
How do I render the board on a dark feature background vs a light base?open

Draw the background in your scene per mode; the board renders on top of whatever you provide.

Question page
How do I scale coin values by the current bet?open

Multiply the coin data.value by the bet in your code before displaying it.

Question page
How do I keep the board centered with jackpot panels flanking it?open

Position the side panels and the reelSet Container around the center in your layout code.

Question page
How do I tear down a feature's 20+ sub-reelsets safely?open

Call destroy() on each sub-ReelSet. For a Hold & Win board, board.destroy() tears down all its cells at once.

Question page
How do I force a guaranteed jackpot for a screenshot?open

The example CheatEngine (in the private @pixi-reels/cheats package) + holdAndWinProgress(coin, 1) guarantees a coin every spin for a screenshot.

Question page
How do I recover an interrupted feature on reload (resume state)?open

Persist feature state server-side and replay it (e.g. board.enter(...) with the saved coins) on reload.

Question page
How do I sequence multi-step server features (round, round, collect)?open

Drive each step with an await (e.g. board.respin(round.hits) per round) against the server's per-step response.

Question page