forked from noxious/client
Worked on pathfinding, character animation & rotation, few enhancements
This commit is contained in:
@ -43,4 +43,4 @@ export function useCameraControls(scene: Phaser.Scene): any {
|
||||
camera,
|
||||
isDragging
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,13 +4,7 @@ import { getTile, tileToWorldXY } from '@/services/zone'
|
||||
import { useGameStore } from '@/stores/game'
|
||||
import { useZoneEditorStore } from '@/stores/zoneEditor'
|
||||
|
||||
export function usePointerHandlers(
|
||||
scene: Phaser.Scene,
|
||||
layer: Phaser.Tilemaps.TilemapLayer,
|
||||
waypoint: Ref<{ visible: boolean; x: number; y: number }>,
|
||||
camera: Ref<Phaser.Cameras.Scene2D.Camera>,
|
||||
isDragging: Ref<boolean>
|
||||
) {
|
||||
export function usePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilemaps.TilemapLayer, waypoint: Ref<{ visible: boolean; x: number; y: number }>, camera: Ref<Phaser.Cameras.Scene2D.Camera>, isDragging: Ref<boolean>) {
|
||||
const gameStore = useGameStore()
|
||||
const zoneEditorStore = useZoneEditorStore()
|
||||
|
||||
@ -68,6 +62,7 @@ export function usePointerHandlers(
|
||||
function setupPointerHandlers() {
|
||||
scene.input.on(Phaser.Input.Events.POINTER_MOVE, updateWaypoint)
|
||||
scene.input.on(Phaser.Input.Events.POINTER_WHEEL, handleZoom)
|
||||
scene.input.on(Phaser.Input.Events.POINTER_MOVE, dragZone)
|
||||
|
||||
// These are for in-game only, not for in the zone editor
|
||||
if (!zoneEditorStore.active) {
|
||||
@ -78,6 +73,7 @@ export function usePointerHandlers(
|
||||
function cleanupPointerHandlers() {
|
||||
scene.input.off(Phaser.Input.Events.POINTER_MOVE, updateWaypoint)
|
||||
scene.input.off(Phaser.Input.Events.POINTER_WHEEL, handleZoom)
|
||||
scene.input.off(Phaser.Input.Events.POINTER_MOVE, dragZone)
|
||||
|
||||
// These are for in-game only, not for in the zone editor
|
||||
if (!zoneEditorStore.active) {
|
||||
@ -89,4 +85,4 @@ export function usePointerHandlers(
|
||||
setupPointerHandlers,
|
||||
cleanupPointerHandlers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user