forked from noxious/client
Timing for animations
This commit is contained in:
parent
a926de8466
commit
1a3a53a229
@ -28,17 +28,16 @@ const texture = computed(() => {
|
|||||||
|
|
||||||
const isFlippedX = computed(() => [6, 4].includes(props.zoneCharacter.character.rotation ?? 0))
|
const isFlippedX = computed(() => [6, 4].includes(props.zoneCharacter.character.rotation ?? 0))
|
||||||
|
|
||||||
const ANIMATION_MS = 500 // Animation duration in milliseconds
|
const ANIMATION_MS = 250 // Animation duration in milliseconds
|
||||||
const imageProps = computed(() => ({
|
const imageProps = computed(() => ({
|
||||||
depth: 1,
|
depth: 1,
|
||||||
originY: [0, 6].includes(props.zoneCharacter.character.rotation ?? 0) ? 4.30 : 5.30,
|
originY: [0, 6].includes(props.zoneCharacter.character.rotation ?? 0) ? 4.33 : 5.33,
|
||||||
flipX: isFlippedX.value,
|
flipX: isFlippedX.value,
|
||||||
texture: texture.value,
|
texture: texture.value,
|
||||||
y: props.zoneCharacter.isMoving ? (scene.time.now % ANIMATION_MS < (ANIMATION_MS / 2) ? 0.5 : -0.5) : 0,
|
y: props.zoneCharacter.isMoving ? (Math.floor((scene.time.now / ANIMATION_MS) % 2) === 0 ? -0.5 : 0) : 0,
|
||||||
x: props.zoneCharacter.isMoving ? (scene.time.now % ANIMATION_MS < (ANIMATION_MS / 2) ? -0.5 : 0.5) : 0,
|
// x: props.zoneCharacter.isMoving ? (Math.floor((scene.time.now / ANIMATION_MS) % 2) === 0 ? -1 : 0) : 0,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
loadSpriteTextures(scene, props.zoneCharacter.character.characterHair?.sprite as SpriteT)
|
loadSpriteTextures(scene, props.zoneCharacter.character.characterHair?.sprite as SpriteT)
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user