huge optimization to network
This commit is contained in:
parent
9c2deb3dcb
commit
8cc663d9a7
2 changed files with 5 additions and 3 deletions
|
@ -12,10 +12,10 @@ class Shooter extends Entity {
|
||||||
this.immortal = true;
|
this.immortal = true;
|
||||||
|
|
||||||
this.serverProps = [
|
this.serverProps = [
|
||||||
'type', 'pos', 'vel', 'you', 'immortal', 'dir'
|
'type', 'pos', 'vel', 'immortal', 'dir'
|
||||||
];
|
];
|
||||||
|
|
||||||
this.dir = Math.random() * 696969;
|
this.dir = Math.random() * 6969;
|
||||||
}
|
}
|
||||||
handleTick(game) {
|
handleTick(game) {
|
||||||
this.ticks++;
|
this.ticks++;
|
||||||
|
|
4
game.js
4
game.js
|
@ -181,7 +181,9 @@ class Game extends GameBasic {
|
||||||
|
|
||||||
na.push(JSON.stringify([this.width, this.height]))
|
na.push(JSON.stringify([this.width, this.height]))
|
||||||
|
|
||||||
client.send(`[${na.join(',')}]`);
|
let dd = `[${na.join(',')}]`;
|
||||||
|
|
||||||
|
client.send(dd);
|
||||||
|
|
||||||
wsEnt.isYou = false;
|
wsEnt.isYou = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue