alt-r to redraw graphics

This commit is contained in:
evanpelle
2024-12-25 17:07:11 -08:00
parent 99e5a62ba6
commit fbdf26cff8
7 changed files with 52 additions and 15 deletions
+10 -5
View File
@@ -1,8 +1,8 @@
import {inherits} from "util"
import {Game} from "../../../core/game/Game";
import {throws} from "assert";
import {Layer} from "./Layer";
import {TransformHandler} from "../TransformHandler";
import { inherits } from "util"
import { Game } from "../../../core/game/Game";
import { throws } from "assert";
import { Layer } from "./Layer";
import { TransformHandler } from "../TransformHandler";
export class TerrainLayer implements Layer {
private canvas: HTMLCanvasElement
@@ -18,6 +18,11 @@ export class TerrainLayer implements Layer {
}
init(game: Game) {
console.log('redrew terrain layer')
this.redraw()
}
redraw(): void {
this.canvas = document.createElement('canvas');
this.context = this.canvas.getContext("2d")