pixi-reels
All mechanics

Mechanics

Split symbols

A winning symbol breaks into two or more copies, and its reel makes room for them.

Demos

splitSymbol() places the cells of a split. The animation in these demos is each demo’s own code. The first demo compares the two height modes, the second lets you split cells yourself, and the third splits on MultiWays.

Grow or keep#

Both boards land the same result and split the same cells, one copy at a time. On the left the reel grows. On the right the reel keeps its height and its cells shrink. The titles show each reel’s cell count and height, read from the engine.

Under 'keep' every symbol on the reel is resized, so its art has to draw at any cell height, as MultiWays art already does. These boards anchor their reels at the top with reelAnchor('start'), so a reel grows downward. With the default 'center' a reel grows in both directions and the board re-centres.

Loading recipe…

Tap a cell to split it#

Tap any cell to split it in two, and the readout prints the call the tap made. Choose grow or keep above the board. Spin to start over, which calls resetColumns() first.

Loading recipe…

Splits on MultiWays#

On MultiWays a reel’s height is fixed, so a split makes room inside the reel and the ways go up with the cell count. The server names the winning symbol and which of its cells split, into two or three copies each. WinLines draws the ways after every split.

The cell count stays within the set’s [minCells, maxCells], as it would after a setShape(). Raise multiways({ maxCells }) to allow more splits. The next spin’s setShape() reshapes every reel from the cell count its split left it with.

Loading recipe…

Stacked symbols on infinity reels#

The infinity reels page has a demo where a stack two to four cells tall splits into more single symbols than it had cells. Its reel grows past the frame in both directions while expand() adds reels.

A reel that a block wider than one reel covers cannot change on its own, or the block’s reels would no longer line up, so splitSymbol() and setColumn() throw there. Every demo on this page splits a symbol one reel wide.

Concept

When a symbol splits, the cell it stands on becomes two or more cells. The server says what the symbol splits into. Pass that list to splitSymbol with the symbol’s reel and cell, and each id gets its own cell. The cells above and below keep their symbols. Any symbol one reel wide can split, either a 1x1 or a stacked big symbol in full view. The call returns the new cells, so the game can animate them.

const { reelIndex, from, count } = reelSet.splitSymbol(reel, cell, ids, { height: 'grow' });

The height option sets what happens to the reel when it gains cells:

  • 'grow' is the default. The cells keep their size and the reel gets taller. The board re-anchors around it as the builder’s reelAnchor says.
  • 'keep' keeps the reel’s height, and every cell on it shrinks to share that height, as cells on a MultiWays reel do. Nothing else moves. This is the default on MultiWays, where a reel’s height is fixed.

resetColumns() puts every reel back to the cells it was built with, at their original size. Both calls are built on setColumn, which shows a column of any length on one reel. The infinity reels page covers splits of stacked symbols on a board that grows.

API

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

  • Reelclass

    One vertical column of a slot board.

  • ReelSetclass

    The whole slot board as one object.

  • The configurator you call before every reel set.

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

  • Win lines drawn over a reel set with pixi-silk: a payline through one cell per reel, or a payway as every winning cell joined to every winning cell on the…

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

Questions

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

How do I fit two half-symbols in one cell (split symbols)?open

Two symbols per cell is not a built-in; render a composite ReelSymbol whose view holds both halves.

Question page