add client side physics

by god did this take a lot of debugging to get working
This commit is contained in:
Asraelite 2016-03-24 00:13:10 +00:00
parent 65f78ec3ac
commit 1412cabbb4
19 changed files with 697 additions and 71 deletions

View file

@ -38,8 +38,20 @@ class Room {
player.team = team;
}
kick(player, reason) {
player.send('kicked', reason);
player.connection.drop();
}
update(self) {
self.players.forEach(player => player.sendUpdate());
//if (this.world.tickCount % 100 == 0)
self.players.forEach(player => {
player.sendUpdate();
if (Date.now() - player.lastAction > 10000) {
//this.kick(player);
//console.log('Kicked ' + player.name);
}
});
}
broadcast(msg, data) {