diff --git a/src/components/game/map/partials/PlacedMapObject.vue b/src/components/game/map/partials/PlacedMapObject.vue index 4c27a6a..c5c2ac8 100644 --- a/src/components/game/map/partials/PlacedMapObject.vue +++ b/src/components/game/map/partials/PlacedMapObject.vue @@ -35,15 +35,19 @@ const imageProps = computed(() => ({ originY: props.placedMapObject.mapObject.originY })) +// ... existing code ... + function calculateObjectPlacement(mapObj: PlacedMapObject) : {x: number; y: number} { let position = tileToWorldXY(props.tileMapLayer, mapObj.positionX, mapObj.positionY) return { - x: position.worldPositionX-mapObj.mapObject.frameWidth/2, - y: position.worldPositionY-mapObj.mapObject.frameHeight/2+config.tile_size.height + x: position.worldPositionX - mapObj.mapObject.frameWidth/2, + y: position.worldPositionY - mapObj.mapObject.frameHeight + (config.tile_size.height * 1.5) } } +// ... existing code ... + onMounted(async () => { await loadTexture(scene, { key: props.placedMapObject.mapObject.id,