more details to the readme

This commit is contained in:
Hanusiak Piotr 2022-01-19 15:32:26 +01:00
parent e70289c61d
commit ef02a06ad7

View File

@ -174,6 +174,9 @@ WA.player.state.toto //will retrieve the variable
```
### Move player to position
```typescript
WA.player.moveTo(x: number, y: number, speed?: number): Promise<{ x: number, y: number }>;
```
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
@ -185,6 +188,11 @@ You can also chain movement like this:
await WA.player.moveTo(250, 250, 10);
await WA.player.moveTo(500, 0, 10);
```
It is possible to get the information about current player's position on stop or when movement is interrupted
```typescript
// Position will store x and y of Player at the moment of movement's end
const position = await WA.player.moveTo(250, 250, 10);
```
### Set the outline color of the player
```