diff --git a/src/composables/pointerHandlers/useGamePointerHandlers.ts b/src/composables/pointerHandlers/useGamePointerHandlers.ts index 29a6b3f..f01225b 100644 --- a/src/composables/pointerHandlers/useGamePointerHandlers.ts +++ b/src/composables/pointerHandlers/useGamePointerHandlers.ts @@ -41,6 +41,8 @@ export function useGamePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilema 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 camera.setScroll( @@ -59,13 +61,13 @@ export function useGamePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilema 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 const pointerTile = getTile(layer, pointer.worldX, pointer.worldY) if (!pointerTile) return - console.log(pointerTile.x, pointerTile.y) - gameStore.connection?.emit('map:character:move', { positionX: pointerTile.x, positionY: pointerTile.y