summaryrefslogtreecommitdiff
path: root/src/engine/TheAbstractionEngine.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/TheAbstractionEngine.ts')
-rw-r--r--src/engine/TheAbstractionEngine.ts18
1 files changed, 14 insertions, 4 deletions
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);