Class MultiPlayerClientInput

Classdesc

MultiPlayerClientInput class, used for handling input on the client side of a multiplayer game

Static

activeInputs - Array of all active inputs

Example

const input = new MultiPlayerClientInput("w", playerClient); // passes all "w" key presses to the server

Constructors

Properties

Methods

Constructors

Properties

down: boolean

Whether or key is currently down

key: string

Key that the input is bound to

sleeping: boolean

Whether or not the input is sleeping (waiting for the player to be ready)

socket: any

Socket.io socket to emit events on

activeInputs: MultiPlayerClientInput[] = []

Methods

  • Activates the input (called when playerClient is ready)

    Parameters

    • playerClient: PlayerClient

      PlayerClient instance to activate the input on

    Returns void

Generated using TypeDoc