From 55bb6fa9301e83a33c26d43311938a9636c92ee9 Mon Sep 17 00:00:00 2001 From: _Bastler <_Bastler@bstly.de> Date: Thu, 27 Jan 2022 14:58:16 +0100 Subject: [PATCH] walk on dbl click --- .../src/Phaser/UserInput/GameSceneUserInputHandler.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts b/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts index 34454413..641b3e79 100644 --- a/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts +++ b/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts @@ -27,7 +27,12 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface { return; } - if (this.lastTime > 0 && pointer.time - this.lastTime < 500 && this.lastX == pointer.x && this.lastY == pointer.y) { + if ( + this.lastTime > 0 && + pointer.time - this.lastTime < 500 && + this.lastX == pointer.x && + this.lastY == pointer.y + ) { const camera = this.gameScene.getCameraManager().getCamera(); const index = this.gameScene .getGameMap() @@ -41,7 +46,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface { .then((path) => { // Remove first step as it is for the tile we are currently standing on path.shift(); - this.gameScene.CurrentPlayer.setPathToFollow(path).catch((reason) => { }); + this.gameScene.CurrentPlayer.setPathToFollow(path).catch((reason) => {}); }) .catch((reason) => { console.warn(reason); @@ -53,7 +58,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface { this.lastY = pointer.y; } - public handlePointerDownEvent(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]): void { } + public handlePointerDownEvent(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]): void {} public handleSpaceKeyUpEvent(event: Event): Event { this.gameScene.activateOutlinedItem();