From b931a8f117b10bb8a238949416960a85f41dedf9 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 1 Jun 2020 13:20:45 +0200 Subject: [PATCH] Fix animation player --- front/src/Phaser/Player/Player.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/src/Phaser/Player/Player.ts b/front/src/Phaser/Player/Player.ts index 1c8458c0..ae40efa5 100644 --- a/front/src/Phaser/Player/Player.ts +++ b/front/src/Phaser/Player/Player.ts @@ -157,13 +157,13 @@ export class Player extends PlayableCaracter implements CurrentGamerInterface, G private playAnimation(direction : string, moving: boolean): void { if (moving && (!this.anims.currentAnim || this.anims.currentAnim.key !== direction)) { - this.anims.play(this.PlayerTexture+'-'+direction); + this.play(this.PlayerTexture+'-'+direction, true); } else if (!moving) { /*if (this.anims.currentAnim) { this.anims.stop(); }*/ - this.anims.play(this.PlayerTexture+'-'+direction); - this.anims.stop(); + this.play(this.PlayerTexture+'-'+direction, true); + this.stop(); } } }