mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-26 19:47:25 +00:00
Update gameboy
This commit is contained in:
parent
5564945e61
commit
b7fbbe7299
4 changed files with 3 additions and 4 deletions
1
main.go
1
main.go
|
|
@ -318,7 +318,6 @@ func faninInput(inputChannel chan int, webRTC *webrtc.WebRTC, playerIndex int) {
|
|||
// encode frame
|
||||
if webRTC.IsConnected() {
|
||||
input := <-webRTC.InputChannel
|
||||
fmt.Println("received", input)
|
||||
// the first 10 bits belong to player 1
|
||||
// the next 10 belongs to player 2 ...
|
||||
// We standardize and put it to inputChannel (20 bytes)
|
||||
|
|
|
|||
0
static/index.html
Normal file
0
static/index.html
Normal file
|
|
@ -78,9 +78,9 @@ KEY_MAP = {
|
|||
67: "start", // c
|
||||
86: "select", // v
|
||||
|
||||
81: "quit" // q
|
||||
81: "quit", // q
|
||||
83: "save", // s
|
||||
76: "load", // l
|
||||
76: "load" // l
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ function sendInput() {
|
|||
// prepare key
|
||||
if (stateUnchange || unchangePacket > 0) {
|
||||
st = "";
|
||||
KEY_BIT.reverse().forEach(elem => {
|
||||
KEY_BIT.slice().reverse().forEach(elem => {
|
||||
st += keyState[elem] ? 1 : 0;
|
||||
});
|
||||
ss = parseInt(st, 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue