Motion

Move and rotate sprites around the stage.

move
// Move a sprite by 10 steps
self.move(10);
turnLeft
// Turn the sprite counter-clockwise by the given number of degrees
self.turnLeft(15);
turnRight
// Turn the sprite clockwise by the given number of degrees
self.turnRight(15);
pointInDirection
// Point the sprite in a specified direction in degrees (0 is up, 90 is right)
self.pointInDirection(90);
pointTowards
// Point the sprite towards another specified sprite or the mouse pointer
self.pointTowards(self);
pointTo
// Point the sprite towards a specified (x, y) coordinate
self.pointTo(30, 30);
goTo
// Set the sprite's position to the specified (x, y) coordinates immediately
self.goTo(0, 0);
goTowards
// Go to the position of another specified sprite or the mouse pointer
self.goTowards(self);
glide
// Glide to a specified (x, y) coordinate over a specified duration in seconds
self.glide(1, 0, 1);
setX
// Set the sprite's x position to the specified value
self.x = 10;
setY
// Set the sprite's y position to the specified value
self.y = 10;
changeX
// Change a sprite's x position by a given amount
self.x += 10;
changeY
// Change a sprite's y position by a given amount
self.y += 10;
setRotationStyle
// Set the sprite's rotation style (e.g. all around, left-right, or dont rotate)
self.setRotationStyle("all around");
ifOnEdgeBounce
// If the sprite touches the edge of the screen, turn the sprite around
self.ifOnEdgeBounce();
x
// Get the current x position of the sprite
self.x;
y
// Get the current y position of the sprite
self.y;
direction
// Get the current direction the sprite is pointing in degrees
self.direction;