The demos start with the smallest board and add one idea at a time. The last sections cover draw order and dimming, which most boards only need once the art is in.
The basic board#
Respin round#
Coins lock where they land and the free cells respin until the grid fills or the respins run out. The board runs the round. The coin values belong to your game.
Loading recipe…
Event trace#
A board plays a whole feature while each board.events event prints to a log as it fires. Use it to see the order of the round before you hook your HUD and sounds onto it.
Loading recipe…
Sprite coins#
The board built from TexturePacker sprites, with no Spine runtime. The numbers blur while they spin and each coin plays a 30-frame flip when it lands.
Loading recipe…
Spine coins#
The board with production Spine coins. MINI and MAJOR tiers reveal on lock, plaques sit beside the grid, and the collect flies the coins into a counter.
Jackpot coins (MINI and MAJOR) are placed by the server only. Their weight is 0, so they never come up on a random strip.
Loading recipe…
Coin values#
Value in the symbol class#
A ReelSymbol written from scratch that draws a coin with a number on it. The value is read back off the landed symbol. Start here if you have not written a symbol class before.
Loading recipe…
Value in the coin data#
The same coin, with the number kept in data instead of the class. One generic coin then carries whatever value the server sends, and the number is painted from coin:locked.
Loading recipe…
Number on existing art#
When the coin art already exists as a sprite, keep it and add the number on top as a second child of the symbol’s view.
Loading recipe…
Coefficient values#
Each coin carries a coefficient between x2 and x50 in coin.data. The board locks the hits and respins only the free cells. The total is summed from board.lockedCoins.
Loading recipe…
Count-up coin#
Each coin’s amount counts up from 0.00 to its value as it settles. The coins start in reading order, so the count runs across the board as a wave.
Loading recipe…
Mystery value#
Coins land blank. On lock, a strip of candidate amounts spins inside the coin face and slows down onto the real value.
Loading recipe…
Upgrade in place#
A held coin steps up the value ladder (5, 10, 25, 50, 100) with a flip and a pop. Nothing respins and no cell moves.
Loading recipe…
Swap to a jackpot tier#
board.setSymbolAt(cell, id, data) puts a different symbol in one cell and rewrites that cell’s entry in the board’s ledger. Here a coin turns into MINI, then MAJOR, and the neighbouring coins stay where they are.
Loading recipe…
Badge that survives a swap#
An x100 badge is stored in coin.data and attached as a child of the symbol’s view. Because it is rebuilt from the data, it comes back after an in-place swap and travels with the coin on a collect flight.
Loading recipe…
Collectors and special coins#
Collector#
When the collector orb locks, the game walks board.lockedCoins, flies the values of the orb’s neighbours into it and calls release() on those cells.
Loading recipe…
Collector with flights#
A collector orb lands and pulls a copy of each coin’s value along a bezier arc, adding to its total as each one arrives.
Loading recipe…
Collector with particles#
The same collect, with a stream of particles trailing each value into the orb.
Loading recipe…
Fly to a meter#
On collect, each coin’s value flies into a meter above the reels. The meter adds up the total and fills a bar toward a target.
Loading recipe…
Payer coin#
A payer orb lands and adds its value to each of the other coins. Changing one line turns it into a doubler.
The payer is placed by the server only. Its weight is 0, so it never comes up on a random strip.
Loading recipe…
Multiplier coin#
A multiplier coin lands, a strike effect plays, an xN badge pops and each coin’s value is multiplied.
Loading recipe…
Row jackpot#
When a coin completes a row, the row flashes coin by coin, the MINI plaque lights and the row total flies into it.
Loading recipe…
Bonus cells#
Some cells are marked as bonus cells from the start. A coin that lands on one lights the cell and doubles its value.
Loading recipe…
Entering the feature#
From the base game#
A normal 5x3 spin that drops into the Hold & Win board when 3 BONUS symbols land, in the same chain, and switches back on feature:end.
Loading recipe…
Feature mode by middleware#
This one does not use the board. It switches a plain ReelSet into a bonus mode at runtime by adding a frame middleware, and back by removing it, with no rebuild. In the bonus mode the middleware turns some visible cells into WILD.
Give your middleware a priority above 10, the priority of target placement, so it runs after the server’s grid is placed and can react to it. The recipe uses 20.
Loading recipe…
Pacing the wave#
Last-cell anticipation#
The anticipateWhen builder option slows the last spinning cell to a tension profile, for the moment when one more coin would fill the board.
Loading recipe…
Skip#
board.skip() puts each spinning cell at its landed position and fires feature:skip. feature:end is still the one event that says the feature is over.
Loading recipe…
Quicken#
board.skip({ mode: 'quicken' }) lands each spinning cell through its stop instead of placing it. The board’s stagger lives in each cell’s minimum spin time, so dropping it lands the whole wave together, and each cell still spins its symbol in and bounces. Add speed: 'turbo' to land the wave on the turbo profile, or call HoldAndWinBuilder.skipMode('quicken') to make quicken the default. feature:skip reports the count and the mode, and the landing events fire as usual.
Loading recipe…
One speed switch#
speeds(normal, turbo, superTurbo) registers each profile in each cell’s SpeedManager, and board.setSpeed(name) switches them all at once, the board’s version of reelSet.setSpeed(). A wave already in flight finishes on its own profile, so a turbo press in the middle of a wave is setSpeed plus skip(). The landing wave steps by each profile’s stopDelay (70, 25 and 0 ms here), so it tightens as the speed goes up and lands in one go on superTurbo, without a stagger function.
Loading recipe…
One cell at a time#
board.reelAt(cell) returns the cell’s own 1x1 ReelSet. You can start it, slam-stop it and read the symbol in it without touching the other cells. Use this when a feature needs a cell to move outside the normal wave.
Loading recipe…
A clover game#
These demos use the art of one real game, where the coins are clovers. Each clover is a Spine 4.2 skeleton.
Base game into the feature#
A fruit base game. Gold clovers show bet-scaled money as they spin past, and the collect, multi, mystery and super clovers carry no amount. Three or more clovers on the stop hand their cells to the Hold & Win board.
Loading recipe…
Bonus board#
The feature on its own. Gold clovers lock with their amounts, the blank cells are the game’s dark clover tile, and the 1 2 3 lamps below are the respin counter.
Loading recipe…
Respin counter#
Three lamps driven by respins:changed alone. Its reason says whether the count changed on seed, hit-reset or miss, so the lamps light or dim without the game working the count out again.
Loading recipe…
Feature clovers#
Clovers without an amount act on the held gold between waves. MULTI doubles each amount, MYSTERY becomes a gold clover with a revealed amount through setSymbolAt, and COLLECT adds the board up onto its own face.
Loading recipe…
Lightning collect#
Held clovers idle until the feature ends. When COLLECT locks, lightning strikes from it to each gold clover’s number and the collect face counts the values into its own. The gold clovers keep their values, and the spent collector turns grey and stays held.
Loading recipe…
Mystery jackpot capsule#
The sealed capsule locks like a coin. Between waves the jackpot titles flick across its face through setBadge and stop on the tier the server sent. Then the plaque lights and the amount appears.
Loading recipe…
Lock animation#
Landing only#
lockAnimation('landing') plays the landing settle on each lock and nothing more. board.playWin() is the single celebration, called when the game decides.
Loading recipe…
Per coin#
lockAnimation can be a function of the coin that locked. Here gold clovers settle with their landing only and COLLECT also celebrates. The celebration waits for the skeleton’s own landing beat (symbol.landing) instead of replacing its track, so the landing plays first and the win follows. The HUD prints when each one finishes.
Loading recipe…
Board size and cell shape#
Rectangular cells#
Hold & Win art is usually wider than it is tall. cellSize takes a width and a height, plus a columnGap and a rowGap, so the board lays out to the art’s own rectangle and the game’s grid shows through the gaps. The clovers are the Spine 4.2 skeletons from the clover game, with idle, landing, win and blur tracks that the engine plays through SpineReelSymbol.
Loading recipe…
5x5 board#
The clover board with five rows, all cells live from the start.
Loading recipe…
Growing board#
Built 5x5 with the top and bottom rows inactive behind a purple sealed tile. Holding enough clovers opens a row with board.activate(), and the next respin spins it too.
Loading recipe…
Background grid#
Real gaps between the cells (columnGap and rowGap) and no cell chrome, so the background shows through. Behind the board is a gradient panel and one rounded frame per cell, drawn with plain PIXI.Graphics on each cell’s exact bounds. A rounded cell mask cuts the tiles’ corners to match.
Loading recipe…
Rounded outer corners#
Each cell has its own mask. cellMask takes a function that is called once per cell with its column, its row and the board size, and returns that cell’s mask strategy. Here the cells clip to a plain rectangle, except the four corner cells, which each round their one outer corner through RoundedRectMaskStrategy({ radius, corners }). With no gap, the fifteen masks read as one rounded window with the panel’s radius. The info argument also carries corners, that same per-cell object worked out for you.
Loading recipe…
Blur while spinning#
Each skeleton has a blur animation that swaps its body to a motion-blur frame, and SpineReelSymbol plays it while the reel moves. The two rows are identical except that the second one opts out of the blur track.
Loading recipe…
Travel direction#
Sideways#
The round on .axis('horizontal'). Each cell is its own 1x1 ReelSet, so the axis only decides which edge a coin scrolls in from. The board still lays out columns by rows, and a lock still claims one cell.
Don’t build this on a plain ReelSet with .orientation('horizontal'). There a reel is a whole row, so the row moves as one strip across the gaps and past the cells that should be locked.
Loading recipe…
Upward#
The round on .axis('vertical', 'reverse'). It also shows the hold that goes with it. respin() spins board.freeCells and nothing else, and respin:start reports which cells are in flight.
On a ReelSet the equivalent is spin({ holdReels }), which holds a whole reel. A board has no holdReels because Hold & Win holds single cells.
Loading recipe…
Draw order and dimming#
Cell draw order#
Each cell is its own reel set, so the clovers the engine lifts above the cells at rest share one layer, drawn in attach order. That order is column by column, which lets the next column’s clover cover a lower clover’s glow. cellZIndex sorts the layer by whatever the board returns, here lower rows in front and the capsule above everything, and the board asks again on each place and landing.
Loading recipe…
Lift one cell#
cellZIndex is the order at rest, and the board asks for it again on each place and landing. A clover that must stay on top while it upgrades can’t get there by returning a bigger number, because the next landing overwrites it during the animation. board.lift(cell) raises the cell on a separate channel and returns a release function. The refresh keeps running underneath without touching the lifted cell, and the release puts the cell back without recomputing anything.
Loading recipe…
Lift and dim#
board.dim({ except }) goes with lift(). The dim draws above the clovers and below anything lifted, so a lifted cell stays in front of it whether or not it is in except. A dim covers cells, not symbol ids, so this collect works out which cells hold the gold clovers it is about to sweep and spares them. The money stays bright and the blanks go dark. The dim fades in and out over fade ms off the board’s own ticker, and fade: 0 cuts.
Loading recipe…
Dim the cell or the art#
There are two ways to push a board back. dim() lays a rectangle over each cell, so the clover goes dark along with the tile it sits in. dimSymbols() tints each symbol towards black instead, so the art sinks and the board stays lit. The same sweep runs twice in the demo, once with each. amount sets the strength on both, and both fade over fade.
This is a board method rather than a few lines of gsap.to because a dimmed cell that swaps its symbol has to keep its dim, and the symbol that left has to lose its tint before the pool gives it to another cell.
Loading recipe…
Dimming one cell up close#
One cell, scaled up, holding a fruit instead of a clover so the cell’s background shows all around the symbol. The blue plate is drawn by cellChrome() on the board, not by a symbol, so dimSymbols() never touches it. amount steps through 0.3, 0.6 and 0.9 and the plate stays the same. Then the same 0.6 through dim() takes the whole cell down.
In the last step the cell is swapped to the empty id. There is no art left to dim, so dimSymbols() changes nothing, neither the symbol that has gone nor the plate.
Watch for this on a real board. If your blank tile is a registered symbol, as the dark tile is in the clover demos (the empty id), it is art and dimSymbols() dims it too. Draw anything that must stay lit in cellChrome(), or name its cell in except.
Loading recipe…