Closed Adel closed 8 years ago
dirty fix:
let storedLevel= null; const init = (level) => { storedLevel = level; draw(canvasMovable, level.entities.filter((e) => e.isMovable)); draw(canvasStatic, level.entities.filter((e) => !e.isMovable)); }; //... window.addEventListener('resize', () => { canvasStatic.width = window.innerWidth * 0.8; canvasStatic.height = window.innerHeight * 0.8; canvasMovable.width = window.innerWidth * 0.8; canvasMovable.height = window.innerHeight * 0.8; init(storedLevel); }, false);
What about put a simple flag let drawStatic = true in the renderer. And in the next loop Renderer.render() { if(drawStatic) {...} drawMovable(); !?
let drawStatic = true
Renderer.render() { if(drawStatic) {...} drawMovable();
It smel better !?
dirty fix: