summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-07 22:55:41 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-07 22:55:41 -0700
commitea6c1eef48ba8d39defdd8cd78adc45ae660caf9 (patch)
tree1ec594f68ea7925b9e10c267ac221e1daf4d1bc6
parentebae24f5a3a251654a1e41be58f52ba2a777d9d7 (diff)
downloadthe-abstraction-engine-ea6c1eef48ba8d39defdd8cd78adc45ae660caf9.tar.gz
the-abstraction-engine-ea6c1eef48ba8d39defdd8cd78adc45ae660caf9.zip
fuck
-rw-r--r--src/engine/levels/index.ts2
-rw-r--r--src/engine/levels/utils.ts2
-rw-r--r--src/engine/systems/Spawner.ts34
3 files changed, 2 insertions, 36 deletions
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<string, string[]> = {
[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<GridSpawn>(
- ComponentNames.GridSpawn,
- )!;
- const hasGrid = entity.hasComponent(SystemNames.Grid);
-
- if (!lambdaSpawn.direction || !hasGrid) {
- return;
- }
-
- const grid = entity.getComponent<Grid>(SystemNames.Grid)!;
-
- const lambda = new FunctionBox(grid.gridPosition, lambdaSpawn.code);
- const lambdaGrid = lambda.getComponent<Grid>(SystemNames.Grid)!;
- lambdaGrid.movingDirection = lambdaSpawn.direction;
- lambda.addComponent(lambdaGrid);
- game.addEntity(lambda);
-
- lambdaSpawn.direction = null;
- entity.addComponent(lambdaSpawn);
- });
- }
-}