Skip to main content

Uncategorized Functions

dofile

local ... = dofile(path)
ParameterTypeDefaultNote
pathstring⚠️ required
ReturnTypeNote
...anyany values returned by the file.

pause

pause()

SaveID

Set an id for the game save data.

caution

Can be only set one during a game's runtime.

SaveID(saveId)
ParameterTypeDefaultNote
saveIdstring⚠️ required

SaveData

Write save data for the game.

caution

The save id has to be set first using SaveID.

SaveData(data)
ParameterTypeDefaultNote
datastring⚠️ required2 KByte maximum.

LoadData

Load saved data for the game.

caution

The save id has to be set first using SaveID.

data = LoadData()
ReturnTypeNote
datastringan empty string when no data has been saved before.

SFX

SFX(slotId, channelId)
ParameterTypeDefaultNote
slotIdnumber⚠️ required
channelIdnumber0an integer in range [0, 3].

Controls

Controls(type)
ParameterTypeDefaultNote
typestring'gamepad'enum: 'gamepad', 'keyboard', 'touch', 'mouse', 'none'.