pixi-reels

Version 4.4.1 for PixiJS v8

Slot reels,ready to spin.

A slot reel engine for PixiJS v8. A builder sets up the reels, typed events report each spin, and the same spins run in Node for tests.

$npm i pixi-reels

Mechanics

Mechanics the engine ships.

Every panel below is the engine running, not a video.

Cascades

Winners pop, survivors fall by the number of holes beneath them, and new symbols drop in. runCascade() runs the loop.

reelSet.runCascade({ detectWinners, nextGrid })See the recipes

Anticipation

Two scatters land, the remaining reels slow and tease. Driven from the result grid with anticipationForScatters().

reelSet.setAnticipation(reels, { stagger: 'sequential' })See the recipes

Any orientation

Strips that scroll sideways, upward, or each their own way. Travel changes motion; facing never changes the art.

.orientation('horizontal').direction('reverse')See the recipes

API

One builder sets up the engine.

  • One import. ReelSetBuilder wires every subsystem.
  • Runtime validation. Forget a required call? You'll know at build().
  • Extension points. Custom symbols, phases and spinning modes.
  • No PixiJS coupling in your logic. Tests run in Node.
your-first-reelset.ts
import { ReelSetBuilder, SpriteSymbol } from 'pixi-reels';

const reelSet = new ReelSetBuilder()
  .reels(5)
  .visibleCells(3)
  .symbolSize(140, 140)
  .symbols((r) => {
    r.register('cherry', SpriteSymbol, { textures: { cherry: cherryTex } });
    r.register('seven',  SpriteSymbol, { textures: { seven: sevenTex } });
    r.register('bar',    SpriteSymbol, { textures: { bar: barTex } });
  })
  .weights({ cherry: 40, seven: 10, bar: 20 })
  .ticker(app.ticker)
  .build();

const result = await reelSet.spin();
console.log(result.symbols); // [[ 'cherry','seven','bar' ], ...]

Partners of pixi-reels

Game studios and providers collaborating on the engine.

In the box

What is in the package.

  1. Fluent builder

    Chain the settings, then build() checks them and throws one error that lists whatever is missing.

  2. Typed events

    Events such as spin:reelLanded and speed:changed, each with a typed payload.

  3. Headless testing

    createTestReelSet and FakeTicker run a whole spin in Node, with no renderer and no DOM.

  4. Mechanic recipes

    More than 200 runnable demos on the mechanics pages, each shown with its source.

  5. Agent-friendly debug

    enableDebug() attaches JSON snapshots and per-spin timings to window, so agents inspect state without reading the canvas. pixi-reels/debug draws the same on the canvas: cells, axes, a metrics plaque and a phase timeline.

  6. Extension points

    Write your own symbols, phases or spinning modes against a named interface.