diff --git a/island.ts b/island.ts index 07ba0bf..983d394 100644 --- a/island.ts +++ b/island.ts @@ -22,6 +22,15 @@ class IslandGrid { this.data = Array(width * height).fill(0); this.xy = dim(width, height); } + + public get(x: number, y: number): number { + return this.data[this.xy(x, y)]; + } + + public set(x: number, y: number, tile: number) { + this.data[this.xy(x, y)] = tile; + console.log(x, y, this.xy(x, y), this.data[this.xy(x, y)]); + } } function renderIslands(islands: IslandGrid, cx: CanvasRenderingContext2D) {