forked from noxious/client
#343: Depth sorting improvement for character component
This commit is contained in:
parent
d2abf8fda8
commit
dffdd0542f
@ -17,7 +17,7 @@ export function useCharacterSpriteComposable(scene: Phaser.Scene, tilemap: Phase
|
||||
const tween = ref<Phaser.Tweens.Tween | null>(null)
|
||||
|
||||
const updateIsometricDepth = (positionX: number, positionY: number) => {
|
||||
isometricDepth.value = calculateIsometricDepth(positionX, positionY, 28, 94, true)
|
||||
isometricDepth.value = calculateIsometricDepth(positionX, positionY, 30, 95, true)
|
||||
}
|
||||
|
||||
const updatePosition = (positionX: number, positionY: number, direction: Direction) => {
|
||||
@ -46,18 +46,15 @@ export function useCharacterSpriteComposable(scene: Phaser.Scene, tilemap: Phase
|
||||
duration,
|
||||
ease: 'Linear',
|
||||
onStart: () => {
|
||||
if (direction === Direction.POSITIVE) {
|
||||
updateIsometricDepth(positionX, positionY)
|
||||
}
|
||||
updateIsometricDepth(positionX, positionY)
|
||||
},
|
||||
onUpdate: () => {
|
||||
updateIsometricDepth(positionX, positionY)
|
||||
currentPositionX.value = characterContainer.value?.x ?? currentPositionX.value
|
||||
currentPositionY.value = characterContainer.value?.y ?? currentPositionY.value
|
||||
},
|
||||
onComplete: () => {
|
||||
if (direction === Direction.NEGATIVE) {
|
||||
updateIsometricDepth(positionX, positionY)
|
||||
}
|
||||
updateIsometricDepth(positionX, positionY)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user