1
0
forked from noxious/client

Improved hair animation

This commit is contained in:
2024-12-20 01:28:48 +01:00
parent 03313cb092
commit 5eabb39ec8
4 changed files with 34 additions and 28 deletions

View File

@ -27,11 +27,14 @@ const texture = computed(() => {
})
const isFlippedX = computed(() => [6, 4].includes(props.zoneCharacter.character.rotation ?? 0))
const ANIMATION_MS = 500 // Animation duration in milliseconds
const imageProps = computed(() => ({
depth: 1,
originY: [0, 6].includes(props.zoneCharacter.character.rotation ?? 0) ? 4.30 : 5.25,
originY: [0, 6].includes(props.zoneCharacter.character.rotation ?? 0) ? 4.30 : 5.30,
flipX: isFlippedX.value,
texture: texture.value
texture: texture.value,
y: props.zoneCharacter.isMoving ? (scene.time.now % ANIMATION_MS < (ANIMATION_MS / 2) ? 1 : 0) : 0,
}))