pxt-calliope/docs/reference/game/move.md

25 lines
532 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Move
2016-07-07 00:19:43 +02:00
Move the sprite the number of LEDs you say.
2016-03-26 00:47:20 +01:00
2016-07-07 00:19:43 +02:00
### Parameters
* ``move by`` is a [number](/reference/types/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.
```blocks
let item = game.createSprite(2, 2);
item.turn(Direction.Right, 45);
item.move(2);
2016-03-26 00:47:20 +01:00
```
2016-07-07 00:19:43 +02:00
### See also
[turn](/reference/game/turn),
[create sprite](/reference/game/create-sprite)