mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-09-09 11:14:19 +08:00
Progress: Server loops & player input;
This commit is contained in:
@@ -36,6 +36,15 @@ GarageServerGame.prototype.removePlayer = function (client) {
|
||||
}
|
||||
};
|
||||
|
||||
GarageServerGame.prototype.addPlayerInput = function (client, input) {
|
||||
for(var i = 0; i < this.players.length; i ++) {
|
||||
if(this.players[i].id === client.id) {
|
||||
this.players[i].inputs.push(input);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.createGame = function (options){
|
||||
return new GarageServerGame(options);
|
||||
};
|
||||
Reference in New Issue
Block a user