forked from noxious/client
#159 : Camera control fixes
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { useGameStore } from '@/stores/gameStore'
|
||||
import { useScene } from 'phavuer'
|
||||
import { watch } from 'vue'
|
||||
import { useZoneStore } from '@/stores/zoneStore'
|
||||
|
||||
@ -9,9 +8,7 @@ export function useCameraControls(scene: Phaser.Scene): any {
|
||||
const camera = scene.cameras.main
|
||||
|
||||
function onPointerDown(pointer: Phaser.Input.Pointer) {
|
||||
if (pointer.event instanceof MouseEvent || pointer.event.shiftKey) {
|
||||
gameStore.setPlayerDraggingCamera(true)
|
||||
}
|
||||
gameStore.setPlayerDraggingCamera(true)
|
||||
}
|
||||
|
||||
function onPointerUp() {
|
||||
@ -21,9 +18,8 @@ export function useCameraControls(scene: Phaser.Scene): any {
|
||||
watch(
|
||||
() => zoneStore.characterLoaded,
|
||||
(characterLoaded) => {
|
||||
if(characterLoaded) {
|
||||
scene.cameras.main.startFollow(scene.children.getByName(gameStore.character!.name) as Phaser.GameObjects.Container);
|
||||
}
|
||||
if(!characterLoaded) return;
|
||||
// scene.cameras.main.startFollow(scene.children.getByName(gameStore.character!.name) as Phaser.GameObjects.Container);
|
||||
}
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user