mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-29 04:50:06 +00:00
Add L R
This commit is contained in:
parent
57ba14a3e6
commit
8484eca293
5 changed files with 20 additions and 12 deletions
|
|
@ -74,12 +74,14 @@ var bindKeysMap = map[int]int{
|
|||
C.RETRO_DEVICE_ID_JOYPAD_B: 1,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_X: 2,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_Y: 3,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_SELECT: 4,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_START: 5,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_UP: 6,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_DOWN: 7,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_LEFT: 8,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_RIGHT: 9,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_L: 4,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_R: 5,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_SELECT: 6,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_START: 7,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_UP: 8,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_DOWN: 9,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_LEFT: 10,
|
||||
C.RETRO_DEVICE_ID_JOYPAD_RIGHT: 11,
|
||||
}
|
||||
|
||||
type CloudEmulator interface {
|
||||
|
|
|
|||
|
|
@ -213,9 +213,6 @@ func (r *Room) startWebRTCSession(peerconnection *webrtc.WebRTC) {
|
|||
}
|
||||
|
||||
if peerconnection.IsConnected() {
|
||||
// the first 10 bits belong to player 1
|
||||
// the next 10 belongs to player 2 ...
|
||||
// We standardize and put it to inputChannel (20 bits)
|
||||
select {
|
||||
case r.inputChannel <- nanoarch.InputEvent{KeyState: input, PlayerIdx: peerconnection.GameMeta.PlayerIndex, ConnID: peerconnection.ID}:
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue