All work

pixi-wheels

Bonus wheels that land where the server says

A wheel engine for PixiJS v8 with a fluent builder, unequal sectors, rings and pointer flap physics. The spin starts before the server answers and still stops exactly on the result.

Docs & demos Source npm
  • The wheel spins before the server answers

    The spin starts on tap and still stops exactly on the server's result, with a deceleration players read as natural.

  • A wheel is data

    Wheels are built from a config, so a new bonus wheel is a file, not a new component.

The wheel starts first and receives its result 0.7 s later, as it would from a server. The x50 sector is used as the near miss.

The hard part of a wheel

Drawing a wheel is easy. Making it feel right is not: the spin has to start the moment the player taps, before the server has decided anything, and then decelerate naturally onto a sector it only learns about mid-spin. If you get the deceleration curve wrong, players notice.

pixi-wheels plans the stop: it takes the current angle and speed when the result arrives and solves a deceleration that lands exactly on the target, with optional near-miss styles (three of them) for anticipation.

Features

  • WheelBuilder with toConfig() / fromConfig(), so a wheel can be authored as data.
  • Unequal sector arcs, dynamic sectors, multiple rings.
  • Pointers with flap physics, ticking against pegs.
  • Painted, textured and Spine skins on a headless core.
  • Typed events (pointer:tick, …) and a headless test harness with a fake ticker.

Like pixi-reels, it stays out of the game's business: outcome math, RTP and audio live in your code.