From a7b0516ac4b0d7754df0e44b0979a8bc3a4ca70d Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 2 Feb 2022 16:38:43 +0100 Subject: [PATCH 1/2] move with touch or right click --- front/src/Phaser/UserInput/GameSceneUserInputHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts b/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts index 6ffd69db..a5f148e2 100644 --- a/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts +++ b/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts @@ -22,7 +22,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface { } public handlePointerUpEvent(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]): void { - if (pointer.rightButtonReleased() || pointer.getDuration() > 250) { + if (!pointer.wasTouch && pointer.leftButtonReleased() || pointer.getDuration() > 250) { return; } for (const object of gameObjects) { From 4b7278b8432e4cd5fefa1600cb3076f3a1b9a1f9 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 2 Feb 2022 16:42:38 +0100 Subject: [PATCH 2/2] add brackets to the condition --- front/src/Phaser/UserInput/GameSceneUserInputHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts b/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts index a5f148e2..4d9ac8a9 100644 --- a/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts +++ b/front/src/Phaser/UserInput/GameSceneUserInputHandler.ts @@ -22,7 +22,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface { } public handlePointerUpEvent(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]): void { - if (!pointer.wasTouch && pointer.leftButtonReleased() || pointer.getDuration() > 250) { + if ((!pointer.wasTouch && pointer.leftButtonReleased()) || pointer.getDuration() > 250) { return; } for (const object of gameObjects) {