diff options
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/MapContext.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/control/MapContext.ts b/src/control/MapContext.ts index 1e417e7..1c0f1a8 100644 --- a/src/control/MapContext.ts +++ b/src/control/MapContext.ts @@ -18,6 +18,7 @@ export default class MapContext { entities: {[key: string]: EntityPosition} = {}; playerEntity: EntityPosition; + constructor(private map: MapData, private inputHandler: InputHandler) { this.playerEntity = new EntityPosition( new Entity('square'), @@ -27,7 +28,12 @@ export default class MapContext { this.addEntity(this.playerEntity); - this.view = new MapView(map, this.entities, (time: number) => this.updateState(time)); + this.view = new MapView( + map, + this.entities, + () => this.playerEntity, + (time: number) => this.updateState(time) + ); inputHandler.addListener(() => { if (this.updateState(performance.now())) |