forked from noxious/client
Better anim. timing
This commit is contained in:
parent
1a3a53a229
commit
97080d7380
@ -28,14 +28,12 @@ const texture = computed(() => {
|
||||
|
||||
const isFlippedX = computed(() => [6, 4].includes(props.zoneCharacter.character.rotation ?? 0))
|
||||
|
||||
const ANIMATION_MS = 250 // Animation duration in milliseconds
|
||||
const imageProps = computed(() => ({
|
||||
depth: 1,
|
||||
originY: [0, 6].includes(props.zoneCharacter.character.rotation ?? 0) ? 4.33 : 5.33,
|
||||
flipX: isFlippedX.value,
|
||||
texture: texture.value,
|
||||
y: props.zoneCharacter.isMoving ? (Math.floor((scene.time.now / ANIMATION_MS) % 2) === 0 ? -0.5 : 0) : 0,
|
||||
// x: props.zoneCharacter.isMoving ? (Math.floor((scene.time.now / ANIMATION_MS) % 2) === 0 ? -1 : 0) : 0,
|
||||
y: props.zoneCharacter.isMoving ? Math.floor(Date.now() / 250) % 2 : 0
|
||||
}))
|
||||
|
||||
loadSpriteTextures(scene, props.zoneCharacter.character.characterHair?.sprite as SpriteT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user