// Move a sprite by 10 steps
self.move(10);
// Turn the sprite counter-clockwise by the given number of degrees
self.turnLeft(15);
// Turn the sprite clockwise by the given number of degrees
self.turnRight(15);
// Point the sprite in a specified direction in degrees (0 is up, 90 is right)
self.pointInDirection(90);
// Point the sprite towards another specified sprite or the mouse pointer
self.pointTowards(self);
// Point the sprite towards a specified (x, y) coordinate
self.pointTo(30, 30);
// Set the sprite's position to the specified (x, y) coordinates immediately
self.goTo(0, 0);
// Go to the position of another specified sprite or the mouse pointer
self.goTowards(self);
// Glide to a specified (x, y) coordinate over a specified duration in seconds
self.glide(1, 0, 1);
// Set the sprite's x position to the specified value
self.x = 10;
// Set the sprite's y position to the specified value
self.y = 10;
// Change a sprite's x position by a given amount
self.x += 10;
// Change a sprite's y position by a given amount
self.y += 10;
// Set the sprite's rotation style (e.g. all around, left-right, or dont rotate)
self.setRotationStyle("all around");
// If the sprite touches the edge of the screen, turn the sprite around
self.ifOnEdgeBounce();
// Get the current x position of the sprite
self.x;
// Get the current y position of the sprite
self.y;
// Get the current direction the sprite is pointing in degrees
self.direction;
// Make the sprite show a speech bubble for a number of seconds
self.sayWait("Hello!", 2);
// Make the sprite show a speech bubble
self.say("Hello!");
// Make the sprite show a thought bubble for a number of seconds
self.thinkWait("Hello!", 2);
// Make the sprite show a thought bubble
self.think("Hello!");
// Set a graphic effect to a given value
self.effects.color = 100;
// Change a graphic effect by a given amount
self.effects.color += 10;
// Remove all graphic effects from the sprite
self.clearEffects();
// Switch the sprite to a specific costume
self.switchCostumeTo("Scrappy");
// Switch the sprite to the next costume
self.nextCostume();
// Switch the stage to a specific backdrop
self.switchBackdropTo("Stage");
// Switch the backdrop and wait until its scripts finish
self.switchBackdropToWait("Stage");
// Switch the stage to the next backdrop
self.nextBackdrop();
// Show the sprite
self.show();
// Hide the sprite
self.hide();
// Set the sprite's size to a percentage
self.size = 100;
// Change the sprite's size by a given amount
self.size += 10;
// Bring the sprite forward one layer
self.goForward();
// Send the sprite backward one layer
self.goBackward();
// Bring the sprite to the front layer
self.goToFront();
// Send the sprite to the back layer
self.goToBack();
// Get the current value of a graphic effect
self.effects.color;
// Check whether the sprite is currently visible
self.visible;
// Get the sprite's current size as a percentage
self.size;
// Get the name of the sprite's current costume
self.costume.name;
// Get the index of the sprite's current costume
self.costume.index;
// Get the name of the stage's current backdrop
self.backdrop.name;
// Get the index of the stage's current backdrop
self.backdrop.index;
// Start playing a sound without waiting for it to finish
self.playSound("click");
// Play a sound and wait until it finishes
self.playSoundUntilDone("click");
// Stop all sounds currently playing
self.stopSounds();
// Set the sprite's volume to a percentage
self.volume = 100;
// Get the current volume as a percentage
self.volume;
// Create a color from a hex value
Color.fromHex("#ff0000");
// Create a color from red, green and blue components
Color.fromRGB(255, 255, 255);
// Erase everything the pen has drawn on the stage
self.penClear();
// Put the pen down so the sprite draws as it moves
self.penDown();
// Lift the pen up so the sprite stops drawing
self.penUp();
// Stamp the sprite's image onto the stage
self.stamp();
// Set the pen's thickness
self.penSize = 100;
// Change the pen's thickness by a given amount
self.penSize += 1;
// Set the pen color
self.penColor = Color.fromHex("#ff0000");
// Get the current pen thickness
self.penSize;
// Get the current pen color
self.penColor;
// Check whether the pen is currently down
self.isPenDown;
// Run code when the green flag is clicked
self.whenFlag(() => {});
// Run code once the sprite has loaded
self.whenLoaded(() => {});
// Run code when the timer passes a number of seconds
self.whenTimerElapsed(1, () => {});
// Run code when the backdrop switches to a specific one
self.whenBackdropChangesTo("Stage", () => {});
// Run code when a key is pressed
self.whenKeyPressed("any", () => {});
// Run code on a mouse event such as a click
self.whenMouse("clicked", () => {});
// Run code when a broadcast message is received
self.whenReceiveMessage("message", () => {});
// Broadcast a message to all sprites without waiting
self.broadcastMessage("message");
// Broadcast a message and wait until all receivers finish
self.broadcastMessageWait("message");
// Pause the script for a number of seconds
self.wait(1);
// Count from one number to another, running code each time
for (let i = 1; i <= 10; i++) {}
// Repeat code while a condition is true
while (false) {}
// Run code once and then repeat while a condition is true
do {} while (false);
// Exit the innermost loop immediately
break;
// Skip to the next iteration of the loop
continue;
// Run code only when a condition is true
if (false) {
}
// Run one block of code or another depending on a condition
if (false) {
} else {
}
// Choose between two values depending on a condition
false ? null : null;
// Try to run code and catch any error it throws
try {
} catch (error) {}
// Throw an error
throw "error";
// Run code when this sprite is cloned
self.whenCloned(() => {});
// Create a clone of a sprite
self.clone();
// Delete this clone
self.delete();
// Stop the whole project
Scrap.stop();
// Stop the other scripts running on this sprite
self.stopOtherScripts();
// Check whether the sprite is touching another sprite
self.isTouching(self);
// Check whether the sprite is touching a color on the backdrop
self.isTouchingBackdropColor(Color.fromHex("#ff0000"));
// Check whether the sprite is touching the edge of the stage
self.isTouchingEdge();
// Check whether the sprite is touching the mouse pointer
self.isTouchingMouse();
// Get the distance from the sprite to a point
self.distanceTo(0, 0);
// Ask the user a question and wait for an answer
self.ask("What's your name?");
// Check whether a key is currently pressed
self.isKeyPressed("any");
// Check whether the mouse button is pressed
self.mouseDown;
// Get the mouse pointer's x position
self.mouseX;
// Get the mouse pointer's y position
self.mouseY;
// Get the width of the stage
self.width;
// Get the height of the stage
self.height;
// Get a property of another sprite or the stage
$["Stage"].width;
// Check whether turbo mode is enabled
Scrap.isTurbo();
// Check whether the sprite can be dragged
self.draggable;
// Set whether the sprite can be dragged
self.draggable = true;
// Reset the timer back to zero
self.resetTimer();
// Get the number of seconds since the timer was reset
self.getTimer();
// Create a date from a specific calendar date
new Date("2026-06-30");
// Get the current date and time
new Date();
// Get a part (such as the year) of a specific date
new Date("2026-06-30").getFullYear();
// Get a part (such as the year) of the current date
new Date().getFullYear();
// Show a browser alert dialog with a message
window.alert("Hello!");
// Show a browser prompt asking the user for text
window.prompt("What's your name?");
// Show a confirmation dialog and get a yes/no answer
window.confirm("Are you sure?");
// A number value
0;
// Add two numbers
10 + 10;
// Subtract one number from another
10 - 10;
// Multiply two numbers
10 * 10;
// Divide one number by another
10 / 10;
// Raise a number to a power
10 ** 10;
// Get the remainder of dividing one number by another
10 % 10;
// Check whether two values are equal
0 == 0;
// Check whether two values are not equal
10 != 10;
// Check whether one value is less than another
10 < 10;
// Check whether one value is less than or equal to another
10 <= 10;
// Check whether one value is greater than another
10 > 10;
// Check whether one value is greater than or equal to another
10 >= 10;
// True only when both values are true
false && false;
// True when at least one value is true
false || false;
// Invert a boolean value
!false;
// A true or false value
true;
// Apply a math function such as absolute value
Math.abs(0);
// Get a random number between 0 and 1
Math.random();
// A mathematical constant such as Pi
Math.PI;
// Convert a value to text
String(0);
// Convert a value to a number
Number("");
// A type such as number, string or boolean
any;
// A generic type such as an array of a given type
Array<any>;
// A type that can be one of several types
number | string;
// A piece of text
"";
// Create an array (list) of values
new Array(0, 0);
// Get the number of items in an array
[].length;
// Reverse the order of an array
[].reverse();
// Join the items of an array into text
[].join(", ");
// Check whether an array contains a value
[].includes(null);
// Get a section of an array between two indexes
[].slice(0, 2);
// Get the item at a given index of an array
[][0];
// Get the position of a value within an array
[].indexOf(null);
// Run code for each item in an array
for (const item of []) {
}
// Define a reusable function
function foo(): void {}
// Return a value from a function
return;