pixi-reels

RandomSymbolControl

pixi-reels


pixi-reels / index / RandomSymbolControl

Interface: RandomSymbolControl

Defined in: frame/SymbolPool.ts:82

Runtime control over the random symbol draw, reachable as reelSet.randomSymbols.

// No EMPTY anywhere on any reel while it spins.
reelSet.randomSymbols.set({ exclude: ['EMPTY'] });

// Reel 2 runs hot on wilds during the feature.
reelSet.randomSymbols.set({ weights: { WILD: 40 } }, { reel: 2 });

// Nothing collectible may sit half-visible above or below the grid.
reelSet.randomSymbols.set({ exclude: ['COIN'] }, { slots: 'buffer' });

// Or one side of the window only: nothing peeks in from above, while
// the cell below the grid is left alone.
reelSet.randomSymbols.set({ exclude: ['COIN'] }, { slots: 'bufferStart' });

// Drop one layer, or all of them.
reelSet.randomSymbols.set(null, { reel: 2 });
reelSet.randomSymbols.clear();

Changes apply to the next draw. symbols already on the strip stay until they wrap out, so set the pools before spin() (or before the reels reach the cells you care about), not after.

Methods#

clear()#

clear(): void;

Defined in: frame/SymbolPool.ts:93

Remove every pool. back to the weights the set was built with.

Returns#

void


set()#

set(pool: SymbolPool | null, scope?: SymbolPoolScope): void;

Defined in: frame/SymbolPool.ts:90

Install (or with null, remove) the pool for one scope. Each scope holds exactly one pool: setting it again replaces the previous one.

Parameters#

ParameterType
poolSymbolPool | null
scope?SymbolPoolScope

Returns#

void

Throws#

If the pool names an unregistered symbol id, or if it leaves some reachable scope with nothing left to draw.


weights()#

weights(scope?: SymbolPoolScope): Record<string, number>;

Defined in: frame/SymbolPool.ts:103

The weights the engine will actually draw from for a scope, excluded ids reported as 0. For tests, debug overlays, and sanity checks.

slots: 'buffer' reports what BOTH sides inherit, before either side’s own pool; ask for 'bufferStart' / 'bufferEnd' for the exact table a side draws from.

Parameters#

ParameterType
scope?SymbolPoolScope

Returns#

Record<string, number>