Skip to content
Snippets Groups Projects
Commit ee4ead95 authored by Bye's avatar Bye
Browse files

basic setup

parent 527beaf3
Branches
No related tags found
No related merge requests found
<style>
canvas {width: 100vw; height: 100vh}
body {margin: 0}
</style>
<canvas id="canvas">
This browser requires the <code>&lt;canvas&gt;</code> element to work
</canvas>
<script src="./src/main.js" type="module"></script>
\ No newline at end of file
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();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment