change syncing

This commit is contained in:
biglyderv 2025-01-03 15:03:33 -05:00
parent 2e524c5c8c
commit 49ef29171a
2 changed files with 3 additions and 2 deletions

View file

@ -203,7 +203,7 @@ class Game extends GameBasic {
that.entities.push(new NPC(false, that))
}
for (let i = 0; i < 10; i++) {
for (let i = 0; i < 103; i++) {
that.entities.push(new Shooter(false, that))
}

View file

@ -281,12 +281,13 @@ class Game extends GameBasic {
this.ws = new WebSocket(origin);
setInterval(function () { that.sync() }, 1000 / 15);
this.opener = function (that) {
that.sync(true);
if (tok) {
that.ws.send(JSON.stringify(["AUTH", tok]));
}
setInterval(function () { that.sync() }, 1000 / 5);
that.ws.addEventListener('message', function (e) { that.recv(e) });
};