From c3242b171cdbb36a26fda04c7148b9b40a5f5c33 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Fri, 1 Mar 2024 21:29:40 -0700 Subject: player movement --- src/engine/TheAbstractionEngine.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/engine/TheAbstractionEngine.ts') diff --git a/src/engine/TheAbstractionEngine.ts b/src/engine/TheAbstractionEngine.ts index 76ca7e9..094555b 100644 --- a/src/engine/TheAbstractionEngine.ts +++ b/src/engine/TheAbstractionEngine.ts @@ -1,7 +1,8 @@ import { Game } from "."; -import { loadAssets } from "./config"; +import { Miscellaneous, loadAssets } from "./config"; import { Player } from "./entities"; import { FacingDirection, Input, Render } from "./systems"; +import { Grid } from "./systems/Grid"; export class TheAbstractionEngine { private game: Game; @@ -22,9 +23,18 @@ export class TheAbstractionEngine { const facingDirectionSystem = new FacingDirection(inputSystem); - [new Render(this.ctx), inputSystem, facingDirectionSystem].forEach( - (system) => this.game.addSystem(system), - ); + [ + new Render(this.ctx), + inputSystem, + facingDirectionSystem, + new Grid( + { width: Miscellaneous.GRID_COLUMNS, height: Miscellaneous.GRID_ROWS }, + { + width: Miscellaneous.GRID_CELL_WIDTH, + height: Miscellaneous.GRID_CELL_HEIGHT, + }, + ), + ].forEach((system) => this.game.addSystem(system)); const player = new Player(); this.game.addEntity(player); -- cgit v1.2.3-70-g09d2