From 06bb4177202b432d5f42141975ec82b5a8837f0e Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 2 Mar 2024 02:22:46 -0700 Subject: slight refactor in collision behavior --- src/engine/TheAbstractionEngine.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/engine/TheAbstractionEngine.ts') diff --git a/src/engine/TheAbstractionEngine.ts b/src/engine/TheAbstractionEngine.ts index 15ef011..2db599b 100644 --- a/src/engine/TheAbstractionEngine.ts +++ b/src/engine/TheAbstractionEngine.ts @@ -1,8 +1,7 @@ import { Game } from "."; import { Miscellaneous, loadAssets } from "./config"; -import { Player, FunctionBox } from "./entities"; -import { FacingDirection, Input, Render } from "./systems"; -import { Grid } from "./systems/Grid"; +import { Player, FunctionBox, Wall } from "./entities"; +import { Grid, FacingDirection, Input, Render } from "./systems"; export class TheAbstractionEngine { private game: Game; @@ -24,7 +23,6 @@ export class TheAbstractionEngine { const facingDirectionSystem = new FacingDirection(inputSystem); [ - new Render(this.ctx), inputSystem, facingDirectionSystem, new Grid( @@ -34,6 +32,7 @@ export class TheAbstractionEngine { height: Miscellaneous.GRID_CELL_HEIGHT, }, ), + new Render(this.ctx), ].forEach((system) => this.game.addSystem(system)); const player = new Player(); @@ -43,6 +42,9 @@ export class TheAbstractionEngine { this.game.addEntity(box); const box2 = new FunctionBox({ x: 4, y: 1 }, "λ x . (x)"); this.game.addEntity(box2); + + const wall = new Wall({ x: 5, y: 3 }); + this.game.addEntity(wall); } public play() { -- cgit v1.2.3-70-g09d2