1
0
forked from noxious/client

Improved map tile initialising

This commit is contained in:
2025-01-10 23:22:32 +01:00
parent 4067ec2585
commit 9de7af961e
5 changed files with 31 additions and 45 deletions

View File

@ -90,7 +90,9 @@ const updatePosition = (positionX: number, positionY: number, direction: Directi
}
},
onUpdate: (tween) => {
// @ts-ignore
currentPositionX.value = tween.targets[0].x
// @ts-ignore
currentPositionY.value = tween.targets[0].y
},
onComplete: () => {
@ -149,8 +151,6 @@ watch(
}
)
watch(() => props.mapCharacter, updateSprite)
const characterTypeStorage = new CharacterTypeStorage()
characterTypeStorage.getSpriteId(props.mapCharacter.character.characterType!).then((spriteId) => {
console.log(spriteId)
@ -172,8 +172,7 @@ onMounted(() => {
mapStore.setCharacterLoaded(true)
// #146 : Set camera position to character, need to be improved still
// scene.cameras.main.startFollow(charContainer.value as Phaser.GameObjects.Container)
// scene.cameras.main.stopFollow()
scene.cameras.main.startFollow(charContainer.value as Phaser.GameObjects.Container)
}
updatePosition(props.mapCharacter.character.positionX, props.mapCharacter.character.positionY, props.mapCharacter.character.rotation)