pixi-reels
All mechanics

Mechanics

Starters

Small complete slots to copy as a starting point, one for each common layout.

Demos

Each starter is a small working slot. The line slots come first, then the other common layouts, then the symbol pools that control what the reels draw while they spin.

Line slots#

Classic 5x3 slot#

A 5x3 slot that pays lines from left to right. Most slot games start from this layout.

Loading recipe…

Horizontal#

The same template with the reels turned sideways. Three reels are stacked down the screen and each one scrolls along x. The change is one call, .orientation('horizontal'), plus the cell size you want on screen.

symbolSize(w, h) and symbolGap(x, y) stay in screen space. On a horizontal set the strip advances by the symbol width, x is the gap between cells and y is the gap between reels. Index space does not change, so reels(3).visibleCells(5) and the ColumnTarget[] you pass to setResult() stay the same.

Loading recipe…

Reverse#

The classic 5x3 with the reels running the other way. Symbols rise and each reel lands from below. The only change from the classic starter is .direction('reverse').

Buffers stay geometric. bufferStart is still the slot above the window, so on a reverse reel the next symbol to come in sits in bufferEnd. Read reel.axis.feedEdge instead of assuming. See orientation and direction for per-reel and mixed-axis setups.

Loading recipe…

Other layouts#

Cascade 6x4#

A tumble slot built on runCascade. The first demo uses card symbols. The second is the same build with Spine art.

Loading recipe…

Loading recipe…

MultiWays#

Each reel lands on its own number of cells between minCells and maxCells on each spin. The number of ways is the product of the per-reel cell counts.

Call reelSet.setShape(rowsPerReel) before setResult(), with serverGrid[i].length === rowsPerReel[i].

Loading recipe…

Hold & Win#

Coins lock where they land and the free cells respin until the grid fills. Board events drive the HUD. The Hold & Win page builds on this board.

Loading recipe…

Which symbols may spawn where#

weights() is one table for the whole set. A pool is layered on top of it for a scope, which can be one reel, the buffer cells, or the buffer cells of one reel. A pool changes only the random draw. An explicit setResult target always wins.

Keep a symbol out of the buffers#

Each spin moves to the next pool state. First there is no pool, then COIN is kept out of the buffers of reel 1 (the second reel, since indices start at 0), then out of the buffers above the window, then out of all buffers. The labels above and below the grid show what the hidden cells hold, so you can watch COIN stop parking there.

Loading recipe…

A draw table per reel#

Each reel can have its own draw table. Watch the spin, not the landing. Reel 0 draws low cards only, reel 2 is mostly wilds while it scrolls, and reel 4 never draws a wild. All five share the same weights() underneath.

Loading recipe…

Concept

Starting templates. Copy one, swap in your art and your math, and build from there.

API

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

  • Tween-only phase between SPIN and STOP for MultiWays slots.

  • A small readable card: rows of monospace text on a smooth rounded plate, with optional swatches (legends) and meters (a speed, a progress). The building block…

  • Fluent builder for HoldAndWinBoard.

  • Reelclass

    One vertical column of a slot board.

  • ReelSetclass

    The whole slot board as one object.

  • The configurator you call before every reel set.

  • 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."

  • Bake spin textures for every symbolId up front (at load or between rounds) so the first spin never pays a capture hitch. Ids that already have a user-provided…

  • ColumnTargetinterface

    Per-reel target shape for ReelSet.setResult and ReelSetBuilder.initialFrame. One object per reel.

  • HwCellinterface

    Grid coordinate of a board cell.

  • Wininterface

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

  • 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 create a reel set and show it on screen?open

Use the fluent ReelSetBuilder: chain .reels(), .visibleCells(), .symbolSize(), register your symbols, then .build() returns a ReelSet (a PixiJS Container) that you add to the stage.

Question page
How do I apply a result that came from my server?open

Map the server payload to ColumnTarget[] and pass it to reelSet.setResult(grid) while the spin promise is still pending.

Question page
How do I gamble/upgrade the number of free spins before they start?open

Run the gamble in your UI and set the final spin count before entering, outside the engine.

Question page
How do I drive every spin from a server (RGS) response?open

Map each server response to ColumnTarget[] and feed setResult while the spin is pending.

Question page