Skip to content

Control functions

Free functions you can call directly in sprite code.

createClone(data?: unknown): void

Create a clone of this sprite, optionally passing data to the clone start handler.

See also Sprite.createClone

Used by

deleteThisClone(): void

Delete this clone.

See also Sprite.deleteThisClone

Used by

forever(body: () => void): void

Run a block of code in an infinite loop.

⏸️ This pauses your script until it finishes — the next line runs only after it’s done.

Used by

repeat(times: number, body: () => void): void

Run a block of code a fixed number of times.

⏸️ This pauses your script until it finishes — the next line runs only after it’s done.

Used by

stop(option: "stopScript" | "stopSprite" | "stopOtherScripts"): void

Stop scripts according to the given option.

See also Sprite.stop

untilLoop(condition: () => boolean, body: () => void): void

Repeat a block of code until the condition becomes true.

⏸️ This pauses your script until it finishes — the next line runs only after it’s done.

wait(seconds: number): void

Pause this script for the given number of seconds.

⏸️ This pauses your script until it finishes — the next line runs only after it’s done.

See also Sprite.wait

Used by

warp(procedure: () => void): void

Run a procedure without screen refresh (warp speed).

See also Sprite.warp