diff --git a/static/gameboy2.html b/static/gameboy2.html index fc97a569..c94a4964 100644 --- a/static/gameboy2.html +++ b/static/gameboy2.html @@ -42,8 +42,8 @@
-
Y
-
X
+
Select
+
Start
A
B
diff --git a/static/js/controller.js b/static/js/controller.js index 4d44855c..9d82b998 100644 --- a/static/js/controller.js +++ b/static/js/controller.js @@ -5,9 +5,9 @@ function showMenuScreen() { $("#game-screen").hide(); $("#menu-screen").hide(); // show - $("#game-screen").show().delay(DEBUG?0:1000).fadeOut(400, () => { + $("#game-screen").show().delay(DEBUG?0:0).fadeOut(0, () => { log("Loading menu screen"); - $("#menu-screen").fadeIn(400, () => { + $("#menu-screen").fadeIn(0, () => { chooseGame(gameIdx, true); screenState = "menu"; }); @@ -19,9 +19,9 @@ function showMenuScreen() { function chooseGame(idx, force = false) { if (idx < 0 || (idx == gameIdx && !force) || idx >= gameList.length) return false; - $("#menu-screen #box-art").fadeOut(DEBUG?0:400, function () { + $("#menu-screen #box-art").fadeOut(DEBUG?0:0, function () { $(this).attr("src", `/static/img/boxarts/${gameList[idx].name}.png`); - $(this).fadeIn(400, function () { + $(this).fadeIn(0, function () { $("#menu-screen #title p").html(gameList[idx].name); }); }); @@ -109,8 +109,13 @@ function doButtonUp(name) { break; case "join": + case "a": + case "b": + case "start": + case "select": startGame(); // log("select game"); + break; } } else if (screenState === "game") { setState(name, false); diff --git a/static/js/ws.js b/static/js/ws.js index 2fbd0b2d..3e81138c 100644 --- a/static/js/ws.js +++ b/static/js/ws.js @@ -209,7 +209,7 @@ function startGame() { // clear menu screen stopInputTimer(); - $("#menu-screen").fadeOut(DEBUG?0:400, function() { + $("#menu-screen").fadeOut(DEBUG?0:0, function() { $("#game-screen").show(); }); // end clear diff --git a/worker/overlord.go b/worker/overlord.go index f1850de6..33efaa4b 100644 --- a/worker/overlord.go +++ b/worker/overlord.go @@ -2,6 +2,8 @@ package worker import ( "log" + "runtime" + "time" "github.com/giongto35/cloud-game/config" "github.com/giongto35/cloud-game/cws" @@ -105,7 +107,9 @@ func (h *Handler) RouteOverlord() { if room.IsPCInRoom(session.peerconnection) { h.detachPeerConn(session.peerconnection) } - //session.Close() + start := time.Now() + runtime.GC() + log.Printf("GC takes %s\n", time.Since(start)) return cws.EmptyPacket },