diff options
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/data/map.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/model/data/map.ts b/src/model/data/map.ts index d6fd835..4d9ecda 100644 --- a/src/model/data/map.ts +++ b/src/model/data/map.ts @@ -1,11 +1,20 @@ +export interface CollisionPolygon { + readonly type: 'polygon'; + readonly vertices: Array<[number, number]>; +} + +export type Collision = CollisionPolygon; + export interface Input { readonly tiles: string[]; readonly layers: number[][][]; + readonly collision: Collision[]; } export class MapData { public readonly tiles: string[]; public readonly layers: number[][][]; + public readonly collision: Collision[]; public readonly width: number; public readonly height: number; @@ -13,6 +22,7 @@ export class MapData { constructor(data: Input) { this.tiles = data.tiles; this.layers = data.layers; + this.collision = data.collision; this.height = this.layers[0].length; this.width = this.layers[0][0].length; |