From c13839ce8d5c338a55de1ccc8c2ce453e54da743 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Fri, 15 Oct 2021 16:14:48 +0200 Subject: [PATCH] Display the real sprite direction on character loaded --- front/src/Phaser/Entity/Character.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/Phaser/Entity/Character.ts b/front/src/Phaser/Entity/Character.ts index 3cdc60dc..fa09ccf2 100644 --- a/front/src/Phaser/Entity/Character.ts +++ b/front/src/Phaser/Entity/Character.ts @@ -62,11 +62,13 @@ export abstract class Character extends Container { .then((textures) => { this.addTextures(textures, frame); this.invisible = false; + this.playAnimation(direction, moving); }) .catch(() => { return lazyLoadPlayerCharacterTextures(scene.load, ["color_22", "eyes_23"]).then((textures) => { this.addTextures(textures, frame); this.invisible = false; + this.playAnimation(direction, moving); }); }); @@ -109,8 +111,6 @@ export abstract class Character extends Container { this.getBody().setOffset(0, 8); this.setDepth(-1); - this.playAnimation(direction, moving); - if (typeof companion === "string") { this.addCompanion(companion, companionTexturePromise); }