pxt-calliope/docs/reference/game/move.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR ()
* Accessibility changes
2017-09-07 13:42:08 -07:00

563 B

Move

Move the sprite the number of LEDs you say.

let item: game.LedSprite = null;
item.move(1);

Parameters

  • a number that means how many LEDs the sprite should move

Example

This program starts a sprite in the middle of the screen. Next, the sprite turns toward the lower-right corner. Finally, it moves two LEDs away to the corner.

let item = game.createSprite(2, 2);
item.turn(Direction.Right, 45);
item.move(2);

See also

turn, create sprite