switch to ES6 modules and fix canvas name
This commit is contained in:
@@ -52,7 +52,7 @@ function update(ctx: CanvasRenderingContext2D, time: number) {
|
||||
}
|
||||
|
||||
function init() {
|
||||
const canvas = document.getElementById("game") as HTMLCanvasElement | null;
|
||||
const canvas = document.getElementById("canvas") as HTMLCanvasElement | null;
|
||||
if (!canvas) throw new Error("unable to get canvas HTML element");
|
||||
const ctx = canvas.getContext("2d") as CanvasRenderingContext2D | null;
|
||||
if (!ctx) throw new Error("unable to get canvas 2D context");
|
||||
|
Reference in New Issue
Block a user