diff --git a/src/engine/Engine.ts b/src/engine/Engine.ts index 78db137..4e6a21a 100644 --- a/src/engine/Engine.ts +++ b/src/engine/Engine.ts @@ -61,6 +61,8 @@ export class Engine { } update(delta: number) { + if (!this.loader.isComplete) return + this.camera.update() this.renderEngine.update() this.experience.update(delta) diff --git a/src/engine/interface/Loader.ts b/src/engine/interface/Loader.ts index f948eb2..ea7d75d 100644 --- a/src/engine/interface/Loader.ts +++ b/src/engine/interface/Loader.ts @@ -1,7 +1,8 @@ import './loader.scss' export class Loader { - element: HTMLDivElement + private readonly element: HTMLDivElement + public isComplete = false constructor() { this.element = document.createElement('div') @@ -39,5 +40,6 @@ export class Loader { complete() { this.element.remove() + this.isComplete = true } }