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.
See also Sprite.createClone
Used by
deleteThisClone
Section titled “deleteThisClone”deleteThisClone(): voidDelete this clone.
See also Sprite.deleteThisClone
Used by
forever
Section titled “forever”forever(body: () => void): voidRun 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
- Animate a sprite with costumes
- Bounce off the edge
- Create a clone army
- Follow the mouse
- Make a sprite grow and shrink
- Point and move towards the mouse
repeat
Section titled “repeat”repeat(times: number, body: () => void): voidRun 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"): voidStop scripts according to the given option.
See also Sprite.stop
untilLoop
Section titled “untilLoop”untilLoop(condition: () => boolean, body: () => void): voidRepeat 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): voidPause 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): voidRun a procedure without screen refresh (warp speed).
See also Sprite.warp