Slow the last reels#
Two scatters land on reels 0 and 2, and setAnticipation([3, 4]) slows the last two reels so they land late.
Loading recipe…
Choose the reels from scatters#
anticipationForScatters reads the result grid and returns the reels to tease. The demo alternates its two modes. 'all-remaining' teases every reel after the one where the scatter count reaches trigger, empty reels included. 'scatter-only' teases only the reels that hold a scatter, and the others stop as usual.
Loading recipe…
Pacing several reels#
One after another#
setAnticipation(reels, 'sequential') holds each teasing reel until the one before it has landed, instead of slowing them all at once.
Loading recipe…
Slower on each reel#
Each teasing reel slows further than the last, from 0.5x to 0.1x of spin speed, holds longer, and lands at that slow speed without returning to full speed first.
Loading recipe…
Teaser symbol#
setAnticipation plus a bufferStart prefill. A chosen symbol sits in the slot above the window while the slow reels decelerate, so the player sees it approach, but it never lands.
Loading recipe…
Turbo#
The SuperTurbo profile sets anticipationDelay to 0, so a plain setAnticipation call skips the tease. Pass a duration override and the tease plays in every speed mode.
Loading recipe…
Skipping the tease#
Skip at any point#
A long sequential tease. A press mid-tease slams the reels onto the result.
Loading recipe…
Protected tease#
The same long tease, but the first press only lands the reels around it. protect: 'once' makes sure both scatters are on screen and the slowdown has visibly started before a second press can end it.
Call setAnticipation before setResult. A press before the result arrives is queued by requestSkip() and fires the moment the result comes in, so the tease has to be registered by then or there is nothing to protect.
Loading recipe…
protect: 'stepwise' moves the tease on by one reel per press instead of ending it in one go. Partial slams, per-reel spin floors and the case for protecting a tease over slowing the skip are on Skip and slam.
Spine scatter animation#
The scatter skeleton’s own near-win clips. The leftmost scatter snaps its jaw, the loop holds while the tease runs, and the rightmost plays the result as it lands. Spins alternate between a hit and a miss.
Loading recipe…
Shaping the slowdown#
The default tease only slows down. These demos replace that shape with explicit speed segments, anchor the tease to a number of symbols, or limit acceleration for the whole spin.
Surge, then crawl#
An ease applied to a speed changes the acceleration in one step. With power2.out the hardest deceleration is on the first frame, so the reel looks like it was switched to a lower speed instead of slowing down.
curve replaces the fixed shape with explicit segments. Speeds are multiples of spinSpeed, so 2 is a real surge and 0.08 a crawl. Segment eases default to power2.inOut, which ramps the acceleration in and out.
reelSet.setAnticipation([2, 3, 4], {
stagger: 260,
curve: [
{ speed: 2, duration: 240, ease: 'power2.in' },
{ speed: 0.08, duration: 620, ease: 'power3.inOut', hold: 300 },
],
});
Passing curve and slowdown together throws, because slowdown is shorthand for a two-segment curve. The profile’s anticipationDelay still decides whether the tease runs at all, so Turbo needs a duration override. The curve’s own durations set the length.
Loading recipe…
A curve per reel#
Two curves of different lengths have no sensible midpoint, so instead of interpolating, curve takes a function, (order, total) => AnticipationSegment[].
order is the reel’s position in the anticipation set, not its index. setAnticipation([4, 2, 3], ...) passes order: 0 to reel 4, the same as slowdown and protect: 'stepwise' do.
Loading recipe…
Tease for a number of symbols#
duration is a time budget, so how far a reel moves depends on its speed. When the tease is timed to symbols passing the window, as in “three more and it lands”, use cells: n. It ends the tease after n symbol pitches, measured on reel.travelledCells, a counter that only goes up and is not reset by the snap at the end of each spin. cells also accepts a function of order, like curve.
The count applies to the last segment. Earlier segments always play in full, otherwise a fast opening segment could use up the count and skip the ones after it. duration is the backstop on that segment, since a reel at rest never reaches a travel target.
Loading recipe…
Limit acceleration#
An ease shapes only the transition it is written for. motionModel('drive', ...) limits acceleration instead. Phases set reel.targetSpeed, and Reel.update moves the speed toward it, so every transition gets the same feel, an interruption is a single new target, and jerkFrames ramps the acceleration itself.
builder.motionModel('drive', { accelFrames: 20, decelFrames: 34, jerkFrames: 260 })
The limits are relative to the profile, in frames to reach the active profile’s full speed. The presets run spinSpeed 30, 50 and 80, so one absolute px/frame^2 limit would make SuperTurbo start slower than Normal. The absolute { accel, decel, jerk } form still works for a game with one profile; mixing the two throws.
It is set at build time and off by default. The default 'tween' model is unchanged. Landing and a skip press are instant, as they are under 'tween'. If the drive cannot reach a segment’s speed in time, it reports that on the notice channel.
Loading recipe…
Tease audio#
anticipation:reel and anticipation:reelEnd mark the start and end of a reel’s tease, which is where a tension loop starts and stops. anticipation:segment ({ reelIndex, index, total, speed, targetSpeed }) fires once per curve segment, so a surge can sound different from the crawl after it. For a pitch ramp that follows the actual slowdown, read reelSet.reels[i].speedNormalized from your own ticker. It is 1 at full spin speed, 0 at rest and above 1 during a surge.
Other reel directions#
Reel indexes do not depend on orientation, so the anticipation code is the same. Only where the teasing reels sit on screen changes.
Horizontal set#
Scatter-driven anticipation with the reels running sideways. anticipationForScatters and setAnticipation work as on a vertical set. Reels are stacked down the screen here, so the last two reels are the bottom two rows, and they slow while moving sideways.
Loading recipe…
Teaser on reels that spin up#
The teaser on a direction('reverse') set. Buffers are geometric, so bufferStart is still the slot above the window, and on a reverse reel symbols have already left through that side.
Put the teaser on the feed edge instead. reel.axis.feedEdge is 'start' on a forward reel and 'end' on a reverse one, so one branch covers both.
Loading recipe…
Faking a near-miss#
Place one scatter fewer than the trigger needs and tease the reel that would have held the last one. The result is always a loss.
Some jurisdictions restrict engineered near-misses. Check with compliance before you ship one.
Loading recipe…