Position coords are updated when animation finish #441
-
HI! In the if (cursors.leftIsDown) {
this.gridEngine.move(sessionId, Direction.LEFT)
} else if (cursors.rightIsDown) {
this.gridEngine.move(sessionId, Direction.RIGHT)
} else if (cursors.upIsDown) {
this.gridEngine.move(sessionId, Direction.UP)
} else if (cursors.downIsDown) {
this.gridEngine.move(sessionId, Direction.DOWN)
}
const position = this.gridEngine.getPosition(sessionId)
this.multiplayer.room.send('move', {
// ... other data
position: enginePosition,
}) When other clients receive new player position I call this.gridEngine.moveTo(sessionId, position) This is because getPosition return updated value when animation finish. There is an option that i can use to get new position while player is moving to next tile? In this video I'm moving player on left screen aa89984a595edebd15a533b70e06ee2c.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I achieved that with |
Beta Was this translation helpful? Give feedback.
I achieved that with
this.gridEngine.positionChangeStarted
method 😅