GameController Documentation

November 3, 2024 ยท View on GitHub

(Generated from generateDocumentation.js to clipboard.)

Methods

constructor({
    updateUi, // callback function
    keydownListeners = {}, // key:left/right/up/down for keyboard
    buttonListeners = {}, // object key:number of functions for game pad buttons
    joystickListeners = {}, // object key:number of functions that take in a number
    gamepadConnectedCallback,
    gamepadDisconnectedCallback,
    manuallyMapGamepadToActions = false,
    hold3ButtonsFor3SecondsToRemapButtons = false,
  })
join(/* https://github.com/dmotz/trystero#api joinRoom */)
startGame()
update(dataOverride = null)
updatePosition(xDelta = 0, yDelta = 0, peerId = selfId)
isHolding3ButtonsDown()
isManuallyRemappingButtons()
manuallyRemapButtons()
getCurrentlyOnButtonsPerGamepad()

Properties

room: object

updateUi: function

localData: object

debug: boolean

debugMore: boolean

gamepads: object

keydownListeners: object

buttonListeners: object

joystickListeners: object

gamepadConnectedCallback: function

gamepadDisconnectedCallback: function

listenersToRemap: object