mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-21 09:08:57 +00:00
Fix gameboy screen not change state
This commit is contained in:
parent
4fcf67e05e
commit
ebf1d93e4c
3 changed files with 7 additions and 6 deletions
2
main.go
2
main.go
|
|
@ -29,7 +29,7 @@ const (
|
|||
debugIndex = "./static/index_ws.html"
|
||||
)
|
||||
|
||||
var indexFN = debugIndex
|
||||
var indexFN = gameboyIndex
|
||||
|
||||
// Time allowed to write a message to the peer.
|
||||
var readWait = 30 * time.Second
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@
|
|||
<br />
|
||||
Game: <br />
|
||||
Use Up, Down, Left, Right to Move <br />
|
||||
Z to jump (A) <br />
|
||||
X to sprint (B) <br />
|
||||
C is start (in game) <br />
|
||||
Z (A butotn) <br />
|
||||
X (B button) <br />
|
||||
C is start (or pause in some games) <br />
|
||||
V is select game <br />
|
||||
Q is super quit <br />
|
||||
S to save <br />
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ conn.onmessage = e => {
|
|||
|
||||
function sendPing() {
|
||||
// TODO: format the package with time
|
||||
//conn.send(JSON.stringify({"id": "pingpong", "data": "pingpong"}));
|
||||
conn.send(JSON.stringify({"id": "pingpong", "data": "pingpong"}));
|
||||
}
|
||||
|
||||
function startWebRTC() {
|
||||
|
|
@ -77,7 +77,6 @@ function startWebRTC() {
|
|||
|
||||
if (pc.iceConnectionState === "connected") {
|
||||
//conn.send(JSON.stringify({"id": "start", "data": ""}));
|
||||
screenState = "game";
|
||||
}
|
||||
else if (pc.iceConnectionState === "disconnected") {
|
||||
endInput();
|
||||
|
|
@ -117,6 +116,8 @@ function startWebRTC() {
|
|||
|
||||
function startGame() {
|
||||
log("Starting game screen");
|
||||
screenState = "game";
|
||||
|
||||
conn.send(JSON.stringify({"id": "start", "data": GAME_LIST[gameIdx].nes, "room_id": roomID.value, "player_index": parseInt(playerIndex.value, 10)}));inputTimer
|
||||
|
||||
// clear menu screen
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue