pxt-calliope/docs/reference/game/move.md
Galen Nickel 3f106307ff
Fix some titles, sigs in ref docs (#2128)
* Fix some title and sigs in ref docs

* better buffer source
2019-06-05 16:28:56 -07:00

560 B

Move

Move the sprite the number of LEDs you say.

game.createSprite(0, 2).move(1);

Parameters

  • leds: 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