From ecaf7f1de03bd11d5486bf573394ae24677398aa Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Tue, 27 Aug 2024 00:33:27 +0200 Subject: [PATCH] Fixed anim --- src/components/sprites/Character.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/sprites/Character.vue b/src/components/sprites/Character.vue index e65383f..6d4f9fd 100644 --- a/src/components/sprites/Character.vue +++ b/src/components/sprites/Character.vue @@ -93,13 +93,16 @@ const charTexture = computed(() => { const spriteId = props.character.characterType.sprite.id const action = props.character.isMoving ? 'walk' : 'idle' - if (rotation === 2 || rotation === 4) { + console.log('rotation', rotation) + if (rotation === 0 || rotation === 6) { + console.log(`${spriteId}-${action}_left_down`) return `${spriteId}-${action}_left_up` - } else if (rotation === 0 || rotation === 6) { + } else if (rotation === 2 || rotation === 4) { + console.log(`${spriteId}-${action}_right_down`) return `${spriteId}-${action}_right_down` } - return `${spriteId}-${action}_left_down` // Default fallback + return `${spriteId}-${action}_left_down` }) const createText = (text: Phaser.GameObjects.Text) => {