From 6c896c3f23895582967aadb8d379d617d757f2fd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 7 Jan 2016 21:01:02 +0100 Subject: Implement collision handling --- src/model/MapData.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/model') diff --git a/src/model/MapData.ts b/src/model/MapData.ts index 54894c0..14f2586 100644 --- a/src/model/MapData.ts +++ b/src/model/MapData.ts @@ -9,12 +9,18 @@ interface Input { export default class MapData { tiles: {[key: string]: {file: string}}; - public collision: string[]; - public layers: string[][][]; + collision: string[]; + layers: string[][][]; + + width: number; + height: number; constructor(data: Input) { this.tiles = data.tiles; this.collision = data.collision; this.layers = data.layers; + + this.height = this.collision.length; + this.width = this.collision[0].length; } } -- cgit v1.2.3