add WA.player.moveTo command to the readme

This commit is contained in:
Hanusiak Piotr 2022-01-19 15:28:49 +01:00
parent 8f40e7a33c
commit e70289c61d

View File

@ -173,6 +173,19 @@ Example:
WA.player.state.toto //will retrieve the variable WA.player.state.toto //will retrieve the variable
``` ```
### Move player to position
Player will try to find shortest path to the destination point and proceed to move there.
```typescript
// Let's move player to x: 250 y: 250 with speed of 10
WA.player.moveTo(250, 250, 10);
```
You can also chain movement like this:
```typescript
// Player will move to the next point after reaching first one
await WA.player.moveTo(250, 250, 10);
await WA.player.moveTo(500, 0, 10);
```
### Set the outline color of the player ### Set the outline color of the player
``` ```
WA.player.setOutlineColor(red: number, green: number, blue: number): Promise<void>; WA.player.setOutlineColor(red: number, green: number, blue: number): Promise<void>;