2016-03-25 16:47:20 -07:00
|
|
|
# Move
|
|
|
|
|
2016-07-06 15:19:43 -07:00
|
|
|
Move the sprite the number of LEDs you say.
|
2016-03-25 16:47:20 -07:00
|
|
|
|
2016-07-18 14:23:05 -07:00
|
|
|
```sig
|
|
|
|
let item: game.LedSprite = null;
|
|
|
|
item.move(1);
|
|
|
|
```
|
|
|
|
|
2017-09-07 13:42:08 -07:00
|
|
|
## Parameters
|
2016-07-06 15:19:43 -07:00
|
|
|
|
2017-03-16 07:57:41 -07:00
|
|
|
* a [number](/types/number) that means how many LEDs the sprite should move
|
2016-07-06 15:19:43 -07:00
|
|
|
|
2017-09-07 13:42:08 -07:00
|
|
|
## Example
|
2016-07-06 15:19:43 -07: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-25 16:47:20 -07:00
|
|
|
```
|
2016-07-06 15:19:43 -07:00
|
|
|
|
2017-09-07 13:42:08 -07:00
|
|
|
## See also
|
2016-07-06 15:19:43 -07:00
|
|
|
|
|
|
|
[turn](/reference/game/turn),
|
|
|
|
[create sprite](/reference/game/create-sprite)
|