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
WheelBuilderwithtoConfig()/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.