Fixed anim

This commit is contained in:
Dennis Postma 2024-08-27 00:33:27 +02:00
parent 90b722b07c
commit ecaf7f1de0

View File

@ -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) => {