Skip to main content

Expand Symbols

Expands every landed copy of a symbol into a column, row, cross, block or single cell and emits the rewritten grid. A maths node that also compiles to the RGS; stateless and seedless.

Wire Reels from Weighted Reels reels or from the Variable that holds the evolving grid. Every cell showing Symbol is an anchor. Once at least Min Count anchors have landed, each anchor is expanded into the Mode shape, and the written cells take Replace With when it is set, else the symbol itself. Fewer anchors, or a Symbol of 0, pass the grid through unchanged with changed false; anchors is still listed.

column rewrites the anchor's whole reel (the classic expanding wild) and row its whole row, each once per distinct column or row; cross does both. block2x2 writes a 2x2 square with the anchor at its top-left and block3x3 a 3x3 square centred on the anchor, both pushed inside the grid edge; overlapping blocks are each written and each listed. cell writes the anchor cell only, which changes something only with Replace With set. An unknown mode is treated as cell.

reels is the rewritten grid in the input shape. spans lists one { row, col, rows, cols, symbol } rectangle per shape written, anchored at its top-left cell; anchors are the triggering cells as [row, col] pairs; expandedCount is the number of cells whose symbol changed and changed is true when that is above zero. Wire spans to pixi.CellOverlay spans, with the symbol's image in its spriteImages, so one oversized sprite covers the block; the reel columns themselves still land single cells.

The grid is state: hold it in a Variable, wire that variable into Reels, write reels back to it and let the win evaluator and the display read the same variable, or the maths scores a grid the player never saw. Fire Do after the spin lands and before scoring. On an empty or ragged grid the node logs the error, writes it to inspect data, empties every output and still fires Done.

Inputs​

Parameters​

DataDescription
Reels (array)The landed grid, reels[col][row], from Weighted Reels reels or the grid Variable.
Symbol (number)Symbol id whose cells expand; 0 = nothing expands. Default 0.
Mode (enum)The shape each anchor expands into. Default column. Options: column, row, cross, block2x2, block3x3, cell.
Replace With (optional) (number)Symbol id written into the expanded cells; empty = write the symbol itself. Default empty.
Min Count (number)Anchors that must land before anything expands; below that the grid passes through. Default 1.

Actions​

SignalDescription
DoRuns the node.

Outputs​

Events​

SignalDescription
DoneFires when the node has finished, on success and failure alike.

Results​

DataDescription
Reels (array)The rewritten grid, same shape as the input. Write it back to the grid Variable.
Spans (array)One { row, col, rows, cols, symbol } rectangle per shape written; wire to pixi.CellOverlay spans.
Anchors (array)[row, col] pairs of the cells that triggered the expansion, listed even when too few to expand.
Expanded Count (number)Number of cells whose symbol changed.
Changed (boolean)True when at least one cell changed. A boolean, not a signal.

Usage​

  1. Hold the landed grid in a Variable and wire it into Reels.
  2. Set Symbol to the expanding symbol and pick a Mode; set Min Count if several must land first.
  3. Fire Do from Weighted Reels Done.
  4. On Done, write reels back to the Variable, then run the win evaluator on it.
  5. Wire spans into pixi.CellOverlay Spans and add the symbol's image to its Sprite Images.