From 49ef29171ad9fb74a61c554f047805e0c5bc038c Mon Sep 17 00:00:00 2001 From: biglyderv Date: Fri, 3 Jan 2025 15:03:33 -0500 Subject: [PATCH] change syncing --- game.js | 2 +- static/js/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/game.js b/game.js index 027cdd2..2159ded 100644 --- a/game.js +++ b/game.js @@ -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)) } diff --git a/static/js/index.js b/static/js/index.js index 9236df7..18c94c9 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -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) }); };