diff --git a/client/src/scenes/cryps.js b/client/src/scenes/cryps.js index 1f282755..2326ac96 100644 --- a/client/src/scenes/cryps.js +++ b/client/src/scenes/cryps.js @@ -29,6 +29,9 @@ function renderCryps() { function resize() { const canvas = document.querySelector("canvas"); + + if (!canvas) return false; + const windowWidth = window.innerWidth; const windowHeight = window.innerHeight; const windowRatio = windowWidth / windowHeight; @@ -42,13 +45,11 @@ function renderCryps() { } } - function somethingElse() { - console.log('grep'); - } - window.addEventListener('mouseup', () => game.registry.set('pan', false)); window.addEventListener('mousedown', () => game.registry.set('pan', true)); - window.addEventListener('resize', () => somethingElse, false); + window.addEventListener('resize', resize, true); + + resize(); return game; }