diff --git a/static/gameboy.html b/static/gameboy.html
index 4bd2c2cf..d7fb3f15 100644
--- a/static/gameboy.html
+++ b/static/gameboy.html
@@ -81,6 +81,11 @@
Instruction
+ Menu:
+ Left, Right to browse the game list
+ V to select the game
+
+ Game:
Use Up, Down, Left, Right to Move
Z to jump (A)
X to sprint (B)
@@ -90,7 +95,7 @@
S to save
L to load
- Your current room:
+ Your current room:
You can join a remote game by roomID.
Remote room ID:
Play as player(1,2):
diff --git a/static/js/ws.js b/static/js/ws.js
index 847f218e..3d779a9d 100644
--- a/static/js/ws.js
+++ b/static/js/ws.js
@@ -12,10 +12,10 @@ function startGame() {
conn = new WebSocket(`ws://${location.host}/ws`);
+ // Clear old roomID
conn.onopen = () => {
log("WebSocket is opened. Send ping");
- roomID = roomID.value
- conn.send(JSON.stringify({"id": "ping", "data": GAME_LIST[gameIdx].nes, "room_id": roomID, "player_index": parseInt(playerIndex.value, 10)}));
+ conn.send(JSON.stringify({"id": "ping", "data": GAME_LIST[gameIdx].nes, "room_id": roomID.value, "player_index": parseInt(playerIndex.value, 10)}));
}
conn.onerror = error => {
@@ -39,7 +39,8 @@ function startGame() {
break;
case "start":
log("Got start");
- currentRoomID.value = d["room_id"]
+ roomID.value = ""
+ currentRoomID.innerText = d["room_id"]
break;
}
}