Class MultiPlayerInputHandler

Classdesc

MultiplayerInputHandler class, used for handling input on the server side of a multiplayer game

Example

const inputHandler = new MultiPlayerInputHandler({
monitors: [
new ServerInputHandler({
key: "w",
fireRate: 10,
on: (socket, playerObject) => {
playerObject.move(0, -1);
}
}),
new ServerInputHandler({
key: "s",
fireRate: 10,
on: (socket, playerObject) => {
playerObject.move(0, 1);
}
})
]
});

Constructors

Properties

Constructors

Properties

monitors: ServerInputHandler[]

Array of ServerInputHandlers to monitor

Generated using TypeDoc