Skip to content
Snippets Groups Projects
Select Git revision
  • ee4ead95430b57e1c8d4d699b20b4d40bcd3269f
  • main default protected
2 results

main.js

Blame
  • main.js 420 B
    
    import Canvas from "../hampsterengine/src/canvas.js";
    import Engine from "../hampsterengine/src/engine.js";
    
    const canvas = new Canvas('canvas');
    const engine = new Engine(canvas);
    
    function main() {
        requestAnimationFrame(main);
        canvas.updateCanvasSize();
    }
    
    function load() {
        if (engine.loading) {
            engine.loadLoop();
            setTimeout(load, 1000/60);
        } else {
            main();
        }
    }
    
    load();