forked from noxious/client
npm run format
This commit is contained in:
@ -34,32 +34,19 @@ export function useGamePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilema
|
||||
|
||||
if (!gameStore.game.isPlayerDraggingCamera) return
|
||||
|
||||
const distance = Phaser.Math.Distance.Between(
|
||||
pointerStartPosition.value.x,
|
||||
pointerStartPosition.value.y,
|
||||
pointer.x,
|
||||
pointer.y
|
||||
)
|
||||
const distance = Phaser.Math.Distance.Between(pointerStartPosition.value.x, pointerStartPosition.value.y, pointer.x, 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(
|
||||
camera.scrollX - (pointer.x - pointer.prevPosition.x) / camera.zoom,
|
||||
camera.scrollY - (pointer.y - pointer.prevPosition.y) / camera.zoom
|
||||
)
|
||||
camera.setScroll(camera.scrollX - (pointer.x - pointer.prevPosition.x) / camera.zoom, camera.scrollY - (pointer.y - pointer.prevPosition.y) / camera.zoom)
|
||||
}
|
||||
|
||||
function handlePointerUp(pointer: Phaser.Input.Pointer) {
|
||||
gameStore.setPlayerDraggingCamera(false)
|
||||
|
||||
const distance = Phaser.Math.Distance.Between(
|
||||
pointerStartPosition.value.x,
|
||||
pointerStartPosition.value.y,
|
||||
pointer.x,
|
||||
pointer.y
|
||||
)
|
||||
const distance = Phaser.Math.Distance.Between(pointerStartPosition.value.x, pointerStartPosition.value.y, pointer.x, pointer.y)
|
||||
|
||||
// If the distance is greater than the drag threshold, return
|
||||
// We do this to prevent the camera from scrolling too quickly
|
||||
|
Reference in New Issue
Block a user