From e16ccf84a5566fdd1594a4875b0f42950cdd413c Mon Sep 17 00:00:00 2001
From: Paolo Brasolin <paolo.brasolin@eurac.edu>
Date: Wed, 6 Apr 2022 18:23:00 +0200
Subject: [PATCH] fix: #fe annoying scene change pointer binding

---
 frontend/src/js/game_over_scene.ts | 4 ++--
 frontend/src/js/welcome_scene.ts   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/frontend/src/js/game_over_scene.ts b/frontend/src/js/game_over_scene.ts
index 2710b47..ecb3b15 100644
--- a/frontend/src/js/game_over_scene.ts
+++ b/frontend/src/js/game_over_scene.ts
@@ -38,8 +38,8 @@ export default class GameOverScene extends Phaser.Scene {
   }
 
   bindEvents() {
-    this.input.keyboard.once("keydown", this.startFight.bind(this));
-    this.input.once("pointerdown", this.startFight.bind(this));
+    this.input.keyboard.once("keyup", this.startFight.bind(this));
+    this.input.once("pointerup", this.startFight.bind(this));
   }
 
   startFight() {
diff --git a/frontend/src/js/welcome_scene.ts b/frontend/src/js/welcome_scene.ts
index 42a80ed..76634b0 100644
--- a/frontend/src/js/welcome_scene.ts
+++ b/frontend/src/js/welcome_scene.ts
@@ -52,8 +52,8 @@ export default class WelcomeScene extends Phaser.Scene {
   }
 
   bindEvents() {
-    this.input.keyboard.once("keydown", this.startFight.bind(this));
-    this.input.once("pointerdown", this.startFight.bind(this));
+    this.input.keyboard.once("keyup", this.startFight.bind(this));
+    this.input.once("pointerup", this.startFight.bind(this));
   }
 
   startFight() {
-- 
GitLab