1
0
forked from noxious/client

Work for teleports

This commit is contained in:
2024-08-23 20:15:58 +02:00
parent 43d5e0614e
commit ad096d4ce3
13 changed files with 303 additions and 168 deletions

View File

@ -27,7 +27,7 @@ export function useGamePointerHandlers(scene: Phaser.Scene, layer: Phaser.Tilema
const pointerTile = getTile(px, py, layer)
if (pointerTile) {
gameStore.connection?.emit('character:move', {
gameStore.connection?.emit('character:initMove', {
positionX: pointerTile.x,
positionY: pointerTile.y
})

View File

@ -5,8 +5,8 @@ export function useCameraControls(scene: Phaser.Scene): any {
const gameStore = useGameStore()
const camera = ref(scene.cameras.main)
const isDragging = ref(false)
let pointerDownTimer: number | null = null
let pointerUpTimer: number | null = null
let pointerDownTimer: number | null | NodeJS.Timeout = null
let pointerUpTimer: number | null | NodeJS.Timeout = null
const DRAG_DELAY = 150
const MOVE_RESET_DELAY = 100

View File

@ -1,7 +1,7 @@
import { computed, type Ref } from 'vue'
import { useZoneEditorStore } from '@/stores/zoneEditor'
import { useGamePointerHandlers } from '@/composables/useGamePointerHandlers'
import { useZoneEditorPointerHandlers } from '@/composables/useZoneEditorPointerHandlers'
import { useGamePointerHandlers } from '@/composables/pointerHandlers/useGamePointerHandlers'
import { useZoneEditorPointerHandlers } from '@/composables/pointerHandlers/useZoneEditorPointerHandlers'
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 zoneEditorStore = useZoneEditorStore()