Sensing functions
Free functions you can call directly in sprite code.
andClones
Section titled “andClones”andClones(): Sprite[]Get this sprite together with all of its clones.
See also Sprite.andClones
askAndWait
Section titled “askAndWait”askAndWait(question: string): voidAsk the user a question and wait for an answer.
⏸️ This pauses your script until it finishes — the next line runs only after it’s done.
See also Sprite.askAndWait
Used by
colorTouching
Section titled “colorTouching”colorTouching(color: Color, target: any): booleanCheck whether this sprite is touching a given color.
See also Sprite.colorTouching
getAnswer
Section titled “getAnswer”getAnswer(): string | nullGet the most recent answer from askAndWait.
See also Sprite.answer
Used by
getLoudness
Section titled “getLoudness”getLoudness(): numberGet the current microphone loudness.
See also Sprite.loudness
getMouseX
Section titled “getMouseX”getMouseX(): numberGet the mouse x position.
See also Sprite.mouse
Used by
getMouseY
Section titled “getMouseY”getMouseY(): numberGet the mouse y position.
See also Sprite.mouse
Used by
getSprites
Section titled “getSprites”getSprites(): Sprite[]Get all sprites in the project.
See also Sprite.sprites
getStage
Section titled “getStage”getStage(): StageGet the stage object.
See also Sprite.stage
getTimer
Section titled “getTimer”getTimer(): numberGet the value of the project timer in seconds.
See also Sprite.timer
isMouseDown
Section titled “isMouseDown”isMouseDown(): booleanCheck whether the mouse button is down.
See also Sprite.mouse
keyPressed
Section titled “keyPressed”keyPressed(key: string): booleanCheck whether a key is currently pressed.
See also Sprite.keyPressed
nearestEdge
Section titled “nearestEdge”nearestEdge(): stringGet the nearest edge this sprite is touching.
See also Sprite.nearestEdge
restartTimer
Section titled “restartTimer”restartTimer(): voidReset the project timer to zero.
See also Sprite.restartTimer
touching
Section titled “touching”touching(target: "mouse" | "edge" | Sprite): booleanCheck whether this sprite is touching a target, “mouse”, or “edge”.
See also Sprite.touching
Used by