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-18 23:23:05 +02:00
|
|
|
```sig
|
2019-12-02 05:58:26 +01:00
|
|
|
game.createSprite(0, 2).move(1);
|
2016-07-18 23:23:05 +02:00
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Parameters
|
2016-07-07 00:19:43 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
* **leds**: a [number](/types/number) that means how many LEDs the sprite should move.
|
2016-07-07 00:19:43 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Example
|
2016-07-07 00:19:43 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See also
|
2016-07-07 00:19:43 +02:00
|
|
|
|
|
|
|
[turn](/reference/game/turn),
|
|
|
|
[create sprite](/reference/game/create-sprite)
|