utils-slots provides the low-level reel and board primitives for slot machine games. It ships two reel types (spinning and cascading), a board enhancement layer, and shared slot state.
Reel types
createReelForSpinning()
Creates a reel that animates by sliding symbols downward into view — the classic slot machine spin mechanic.SpinningReelCreateOptions):
reelState fields:
SpinningReelSpinOptions):
createReelForCascading()
Creates a reel that animates symbols falling out downward and new symbols falling in from above — the cascade/tumble mechanic.createReelForSpinning (same preSpin, prepareToSpin, spin, stop, setSymbolsWithRawSymbols, readyToSpinEffect methods).
The cascading reel exposes a CascadingReelMotion state: 'fallingOut' | 'hanging' | 'fallingIn' | 'stopped'.
Cascading spin options (CascadingReelSpinOptions):
Board enhancement layer
The board enhancement layer wraps an array of reels and coordinates spin timing, anticipation, and pre-spin across all columns.createEnhanceBoard()
Returns anenhanceBoard function that adds preSpin, spin, settle, stop, and readyToSpinEffect to any array of reels:
preSpin (createEnhanceBoardPreSpin)
Starts the pre-spin animation loop on all reels simultaneously. SetsstateSlots.isPreSpinning = true:
spin() is called. Turbo mode is captured at pre-spin start so it applies uniformly to all reels.
spin (createEnhanceBoardSpin)
Stops the pre-spin loop and drives all reels to their target symbols. Handles anticipation and turbo automatically:revealEvent.anticipation — an array of numbers, one per reel. Reels after the first anticipated reel set noStop = true so they keep spinning until explicitly released.
