pixi-reels splits into three concentric rings: the builder wires things, the reel set owns the scene graph and the spin controller, and the test harness + cheats let you drive it headlessly. Every line of the diagram below maps to a file you can click through to in the API reference.
How the pieces talk to each other
ReelSetBuilder is the only class a consumer ever instantiates
directly. Its .build() method constructs the ReelSet
and every subsystem it needs — you never new a SpinController
or a Reel yourself.
Inside the reel set:
SpinControllerorchestrates the spin lifecycle across all reels. It listens to the PixiJS ticker (via aTickerRef) and drives each reel's phase machine.SpeedManagerholds named speed profiles (normal,turbo,super-turbo) and emitsspeed:changedwhen the active one swaps.SymbolSpotlighthandles post-spin win animations: dim losers, promote winners, cycle through multiple pay lines.ReelViewportis the PixiJSContainerthat masks each reel column to the visible rows.
Each Reel is a scene node that owns its ReelSymbol[]
(pooled, swappable), a ReelMotion handler, and a StopSequencer
for landing on specific frames. Spin phases (START, SPIN,
ANTICIPATION, STOP) are per-reel, which is how
anticipation can slow a single reel while the others land normally.
The dotted outer ring
Everything under src/testing/ is tree-shakeable: it exports
FakeTicker, HeadlessSymbol, and the
createTestReelSet harness. You can build a working 5×3 reel
set in Node with no renderer, run a full spin synchronously, and assert
the landed grid — see Testing model
for how it hangs together.
What lives where
core/— ReelSet, Builder, Reel, Viewport, Motion, StopSequencerspin/— SpinController, phases, spinning modessymbols/— ReelSymbol + Sprite/AnimatedSprite/Spine/Headlessspeed/— SpeedManager + profilesframe/— FrameBuilder, middleware, RNGspotlight/— win animationsevents/— typed EventEmitter, event typestesting/— FakeTicker, HeadlessSymbol, harnessdebug/— debugSnapshot, debugGrid, enableDebug
cheats.ts— CheatEngine + built-in cheatscascadeLoop.ts— runCascade, tumbleToGrid, diffCellsBlurSpriteSymbol.ts— sprite symbol with motion-blur swapprototypeSpriteLoader.ts— prototype-symbols atlas loadermockServer.ts— fake spin responsesseededRng.ts— Mulberry32 PRNG
Read the next page for the class composition tree in detail, or skip ahead to Events for the full event choreography.