Fix play anim
authorgparant <g.parant@thecodingmachine.com>
Tue, 7 Apr 2020 21:56:16 +0000 (23:56 +0200)
committergparant <g.parant@thecodingmachine.com>
Tue, 7 Apr 2020 21:56:16 +0000 (23:56 +0200)
front/src/Phaser/Player/Animation.ts

index 38f2afd3dcc6abdcdba695a4bcfb4d21e977505a..eb8298f452d047be825d11c279a6ff0e3027e14d 100644 (file)
@@ -49,11 +49,7 @@ export const getPlayerAnimations = (PlayerValue : string): AnimationData[] => {
 
 export const playAnimation = (Player : Phaser.GameObjects.Sprite, direction : string) => {
     if (!Player.anims.currentAnim || Player.anims.currentAnim.key !== direction) {
-        if (direction !== PlayerAnimationNames.None) {
-            Player.anims.play(direction);
-        } else if (Player.anims.isPlaying) {
-            Player.anims.stop();
-        }
+        Player.anims.play(direction);
     } else if (direction === PlayerAnimationNames.None && Player.anims.currentAnim) {
         Player.anims.currentAnim.destroy();
     }