Only sending move events if the player actually moved
If the player did not move a pixel (and if it did not change direction), then do not send an event to save bandwidth and processing.
This commit is contained in:
parent
b51ce51847
commit
86abdfe30b
2 changed files with 10 additions and 5 deletions
|
@ -50,7 +50,7 @@ export class PlayableCaracter extends Phaser.Physics.Arcade.Sprite {
|
|||
|
||||
stop(){
|
||||
this.setVelocity(0, 0);
|
||||
this.play(PlayerAnimationNames.None, true);
|
||||
this.anims.stop();
|
||||
}
|
||||
|
||||
say(text: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue