add client side physics
by god did this take a lot of debugging to get working
This commit is contained in:
parent
65f78ec3ac
commit
1412cabbb4
19 changed files with 697 additions and 71 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue