diff options
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/data/map.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/model/data/map.ts b/src/model/data/map.ts index b36f6b5..81ce051 100644 --- a/src/model/data/map.ts +++ b/src/model/data/map.ts @@ -1,14 +1,18 @@ import { Collision } from './collision'; +export interface MapLayer { + readonly tiles: number[][]; +} + export interface MapDataInput { readonly tiles: string[]; - readonly layers: number[][][]; + readonly layers: MapLayer[]; readonly collision: Collision[]; } export class MapData { public readonly tiles: string[]; - public readonly layers: number[][][]; + public readonly layers: MapLayer[]; public readonly collision: Collision[]; public readonly width: number; @@ -19,7 +23,7 @@ export class MapData { this.layers = data.layers; this.collision = data.collision; - this.height = this.layers[0].length; - this.width = this.layers[0][0].length; + this.height = this.layers[0].tiles.length; + this.width = this.layers[0].tiles[0].length; } } |