From cbb88091bdf69cc8752ef1cc3662dc0b99e3ead6 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 2 Mar 2024 05:30:17 -0700 Subject: key lock / player curry collisions --- src/engine/TheAbstractionEngine.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/engine/TheAbstractionEngine.ts') diff --git a/src/engine/TheAbstractionEngine.ts b/src/engine/TheAbstractionEngine.ts index 7f71fd5..e84093f 100644 --- a/src/engine/TheAbstractionEngine.ts +++ b/src/engine/TheAbstractionEngine.ts @@ -1,12 +1,21 @@ import { Game } from "."; import { Miscellaneous, loadAssets } from "./config"; -import { Player, FunctionBox, Wall, LambdaFactory } from "./entities"; +import { + Player, + FunctionBox, + Wall, + LambdaFactory, + Key, + LockedDoor, + Curry, +} from "./entities"; import { Grid, FacingDirection, Input, Render, LambdaFactory as LambdaFactorySpawnSystem, + Collision, } from "./systems"; export class TheAbstractionEngine { @@ -39,6 +48,7 @@ export class TheAbstractionEngine { }, ), new LambdaFactorySpawnSystem(), + new Collision(), new Render(this.ctx), ].forEach((system) => this.game.addSystem(system)); @@ -55,6 +65,15 @@ export class TheAbstractionEngine { const factory = new LambdaFactory({ x: 6, y: 6 }, "λ x . (x)", 10); this.game.addEntity(factory); + + const lockedDoor = new LockedDoor({ x: 8, y: 8 }); + this.game.addEntity(lockedDoor); + + const key = new Key({ x: 7, y: 7 }); + this.game.addEntity(key); + + const curry = new Curry({ x: 9, y: 8 }); + this.game.addEntity(curry); } public play() { -- cgit v1.2.3-70-g09d2