forked from noxious/client
Added comments
This commit is contained in:
parent
7546116878
commit
7b1dcf7ce3
@ -41,6 +41,8 @@ export function useGamePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilema
|
|||||||
pointer.y
|
pointer.y
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// If the distance is less than the drag threshold, return
|
||||||
|
// We do this to prevent the camera from scrolling too quickly
|
||||||
if (distance <= dragThreshold) return
|
if (distance <= dragThreshold) return
|
||||||
|
|
||||||
camera.setScroll(
|
camera.setScroll(
|
||||||
@ -59,13 +61,13 @@ export function useGamePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilema
|
|||||||
pointer.y
|
pointer.y
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// If the distance is greater than the drag threshold, return
|
||||||
|
// We do this to prevent the camera from scrolling too quickly
|
||||||
if (distance > dragThreshold) return
|
if (distance > dragThreshold) return
|
||||||
|
|
||||||
const pointerTile = getTile(layer, pointer.worldX, pointer.worldY)
|
const pointerTile = getTile(layer, pointer.worldX, pointer.worldY)
|
||||||
if (!pointerTile) return
|
if (!pointerTile) return
|
||||||
|
|
||||||
console.log(pointerTile.x, pointerTile.y)
|
|
||||||
|
|
||||||
gameStore.connection?.emit('map:character:move', {
|
gameStore.connection?.emit('map:character:move', {
|
||||||
positionX: pointerTile.x,
|
positionX: pointerTile.x,
|
||||||
positionY: pointerTile.y
|
positionY: pointerTile.y
|
||||||
|
Loading…
x
Reference in New Issue
Block a user