Added comments

This commit is contained in:
Dennis Postma 2025-01-09 16:00:36 +01:00
parent 7546116878
commit 7b1dcf7ce3

View File

@ -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