console.log("Raytracer (frameworkv3) starting"); var game = new Game(); window.onload = function () { game.preloadImagesThenStart( [ { name: "stone", url: "images/stone.png" }, { name: "wood", url: "images/wood.png" }, { name: "shotgun", url: "images/shotgun.png" }, { name: "machinegun", url: "images/machinegun.png" }, { name: "pulserifle", url: "images/pulserifle.png" } ], function () { Tiles.bindImages(game.images); World.loadLevel(0); Player.resetToSpawn(); var w = Math.max(320, window.innerWidth - 2); var h = Math.max(240, window.innerHeight - 2); var scene = new RaycastScene(w, h); game.loadScene(scene); window.addEventListener("resize", function () { scene.size.x = Math.max(320, window.innerWidth - 2); scene.size.y = Math.max(240, window.innerHeight - 2); }); } ); };