Control functions
Free functions you can call directly in sprite code.
createClone
Section titled “createClone”createClone(data?: unknown): voidCreate a clone of this sprite, optionally passing data to the clone start handler.
Delegates to Sprite.createClone
deleteThisClone
Section titled “deleteThisClone”deleteThisClone(): voidDelete this clone.
Delegates to Sprite.deleteThisClone
forever
Section titled “forever”forever(body: () => void): voidRun a block of code in an infinite loop.
Pauses the script (a generator). In sprite code the free-function wrapper awaits it for you.
repeat
Section titled “repeat”repeat(times: number, body: () => void): voidRun a block of code a fixed number of times.
Pauses the script (a generator). In sprite code the free-function wrapper awaits it for you.
stop(option: "stopScript" | "stopSprite" | "stopOtherScripts"): voidStop scripts according to the given option.
Delegates to Sprite.stop
untilLoop
Section titled “untilLoop”untilLoop(condition: () => boolean, body: () => void): voidRepeat a block of code until the condition becomes true.
Pauses the script (a generator). In sprite code the free-function wrapper awaits it for you.
wait(seconds: number): voidPause this script for the given number of seconds.
Pauses the script (a generator). In sprite code the free-function wrapper awaits it for you.
Delegates to Sprite.wait
warp(procedure: () => void): voidRun a procedure without screen refresh (warp speed).
Delegates to Sprite.warp