Slot Engine is in Beta - Stable, but may contain minor bugs
Slot EngineSlot Engine

Game Service

Service providing common utility functions.


Methods

getReelsetById()

MethodType
ctx.services.game.getReelsetById()(gameMode, id) => Reels

Parameters

ParameterType
gameModestring
idstring

Retrieves a reel set by its ID within a specific game mode.

getResultSetByCriteria()

MethodType
ctx.services.game.getResultSetByCriteria()(mode, criteria) => ResultSet

Parameters

ParameterType
modestring
criteriastring

Retrieves a result set by its criteria within a specific game mode.

getSymbolArray()

MethodType
ctx.services.game.getSymbolArray()() => GameSymbol[]

Returns all symbols as an array.

getCurrentGameMode()

MethodType
ctx.services.game.getCurrentGameMode()() => GameMode

Gets the configuration for the current game mode.

awardFreespins()

MethodType
ctx.services.game.awardFreespins()(amount) => void

Parameters

ParameterType
amountnumber

Adds the given number of free spins to the state.

dedupeWinSymbols()

MethodType
ctx.services.game.dedupeWinSymbols()(winCombinations) => { reelIdx, rowIdx }

Parameters

ParameterType
winCombinationsWinCombination[]

Return Object

ParameterType
reelIdxnumber
rowIdxnumber

When working with winCombinations returned from any win type, make sure you dedupe winning symbols. It may be possible for the same symbol (e.g. Wild) to be included in multiple win combinations. If you then wanted to tumble the board based on the winning symbols, that Wild symbol would be tumbled multiple times, which might lead to errors.

Another example is games like "Sugar Rush", where winning combinations increase a multiplier on the board. You wouldn't want the same symbol to trigger a multiplier increase multiple times.

Use of AI on this page: Some texts were improved with or written by AI.

On this page