forked from noxious/client
Loop fix, added btn-indigo to general styling
This commit is contained in:
@ -59,7 +59,7 @@ export function useCharacterSpriteComposable(scene: Phaser.Scene, tilemap: Phase
|
||||
})
|
||||
}
|
||||
|
||||
const playAnimation = (animation: string, loop = false) => {
|
||||
const playAnimation = (animation: string, loop = false, ignoreIfPlaying = true) => {
|
||||
if (!characterSprite.value || !characterSpriteId.value) return
|
||||
|
||||
const fullAnimationName = `${characterSpriteId.value}-${animation}_${currentDirection.value}`
|
||||
@ -76,7 +76,7 @@ export function useCharacterSpriteComposable(scene: Phaser.Scene, tilemap: Phase
|
||||
characterSprite.value.anims.play({
|
||||
key: fullAnimationName,
|
||||
repeat: loop ? -1 : 0
|
||||
})
|
||||
}, ignoreIfPlaying)
|
||||
}
|
||||
|
||||
const calcDirection = (oldPositionX: number, oldPositionY: number, newPositionX: number, newPositionY: number): Direction => {
|
||||
|
Reference in New Issue
Block a user