diff --git a/public/src/js/controller.js b/public/src/js/controller.js index 69fbfd7..e7a8946 100644 --- a/public/src/js/controller.js +++ b/public/src/js/controller.js @@ -36,13 +36,15 @@ class Controller{ syncWith.game.startDate = this.game.startDate this.syncWith = syncWith } - this.startMainLoop() - if(!this.multiplayer){ - debugObj.controller = this - if(debugObj.debug){ - debugObj.debug.updateStatus() + requestAnimationFrame(() => { + this.startMainLoop() + if(!this.multiplayer){ + debugObj.controller = this + if(debugObj.debug){ + debugObj.debug.updateStatus() + } } - } + }) } startMainLoop(){ this.mainLoopStarted = false