From ea6c1eef48ba8d39defdd8cd78adc45ae660caf9 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Thu, 7 Mar 2024 22:55:41 -0700 Subject: [PATCH] fuck --- src/engine/levels/index.ts | 2 +- src/engine/levels/utils.ts | 2 +- src/engine/systems/Spawner.ts | 34 ---------------------------------- 3 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 src/engine/systems/Spawner.ts diff --git a/src/engine/levels/index.ts b/src/engine/levels/index.ts index 36291aa..bae7fea 100644 --- a/src/engine/levels/index.ts +++ b/src/engine/levels/index.ts @@ -7,6 +7,6 @@ import { LevelNames } from "."; import { LevelSelection, Tutorial, Level } from "."; export const LEVELS: Level[] = [new LevelSelection(), new Tutorial()]; -export const LEVEL_PROGRESSION = { +export const LEVEL_PROGRESSION: Record = { [LevelNames.LevelSelection]: [LevelNames.Tutorial], }; diff --git a/src/engine/levels/utils.ts b/src/engine/levels/utils.ts index 7228f2b..770ba3c 100644 --- a/src/engine/levels/utils.ts +++ b/src/engine/levels/utils.ts @@ -1,4 +1,4 @@ -import { Entity } from "../entities"; +// import { Entity } from "../entities"; // TODO //export const levelFormatToEntityList = (lines: string[]): Entity[] => { diff --git a/src/engine/systems/Spawner.ts b/src/engine/systems/Spawner.ts deleted file mode 100644 index 6a4d382..0000000 --- a/src/engine/systems/Spawner.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { System, SystemNames } from "."; -import { Game } from ".."; -import { ComponentNames, Grid, GridSpawn } from "../components"; -import { FunctionBox } from "../entities"; - -export class GridSpawner extends System { - constructor() { - super(SystemNames.GridSpawner); - } - - public update(_dt: number, game: Game) { - game.forEachEntityWithComponent(ComponentNames.GridSpawn, (entity) => { - const lambdaSpawn = entity.getComponent( - ComponentNames.GridSpawn, - )!; - const hasGrid = entity.hasComponent(SystemNames.Grid); - - if (!lambdaSpawn.direction || !hasGrid) { - return; - } - - const grid = entity.getComponent(SystemNames.Grid)!; - - const lambda = new FunctionBox(grid.gridPosition, lambdaSpawn.code); - const lambdaGrid = lambda.getComponent(SystemNames.Grid)!; - lambdaGrid.movingDirection = lambdaSpawn.direction; - lambda.addComponent(lambdaGrid); - game.addEntity(lambda); - - lambdaSpawn.direction = null; - entity.addComponent(lambdaSpawn); - }); - } -}