forked from noxious/client
tried to un-spaghetti my code
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Sprite ref="sprite" texture="IMap" :x="position.x" :y="position.y" />
|
||||
<Sprite ref="sprite" texture="player" :x="position.x" :y="position.y" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@ -27,10 +27,13 @@ const scene = useScene()
|
||||
const position = reactive({ x: 0, y: 0 });
|
||||
|
||||
if (props.player !== undefined) {
|
||||
console.log('player', props.player);
|
||||
position.x = props.player?.coords.x;
|
||||
position.y = props.player?.coords.y;
|
||||
}
|
||||
|
||||
const pointer_tile = ref(undefined);
|
||||
|
||||
function onPointerClick(pointer: Phaser.Input.Pointer) {
|
||||
const px = scene.cameras.main.worldView.x + pointer.x;
|
||||
const py = scene.cameras.main.worldView.y + pointer.y;
|
||||
|
Reference in New Issue
Block a user