From ebae24f5a3a251654a1e41be58f52ba2a777d9d7 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Thu, 7 Mar 2024 22:49:43 -0700 Subject: level system! --- src/engine/TheAbstractionEngine.ts | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'src/engine/TheAbstractionEngine.ts') diff --git a/src/engine/TheAbstractionEngine.ts b/src/engine/TheAbstractionEngine.ts index 93684ef..29bc553 100644 --- a/src/engine/TheAbstractionEngine.ts +++ b/src/engine/TheAbstractionEngine.ts @@ -1,14 +1,6 @@ import { Game } from "."; import { Miscellaneous, loadAssets } from "./config"; -import { - Player, - Wall, - LambdaFactory, - Key, - LockedDoor, - Curry, - FunctionApplication, -} from "./entities"; +import { LevelNames } from "./levels"; import { Grid, FacingDirection, @@ -18,6 +10,7 @@ import { GridSpawner, Life, Music, + Level, } from "./systems"; export class TheAbstractionEngine { @@ -40,6 +33,7 @@ export class TheAbstractionEngine { const facingDirectionSystem = new FacingDirection(inputSystem); [ + new Level(LevelNames.LevelSelection), inputSystem, facingDirectionSystem, new Grid( @@ -55,27 +49,6 @@ export class TheAbstractionEngine { new Music(), new Render(this.ctx), ].forEach((system) => this.game.addSystem(system)); - - const player = new Player(); - this.game.addEntity(player); - - const wall = new Wall({ x: 5, y: 3 }); - this.game.addEntity(wall); - - const factory = new LambdaFactory({ x: 3, y: 3 }, "(λ (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); - - const application = new FunctionApplication({ x: 5, y: 5 }, "(_INPUT key)"); - this.game.addEntity(application); } public play() { -- cgit v1.2.3-70-g09d2