fuck
This commit is contained in:
parent
ebae24f5a3
commit
ea6c1eef48
@ -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],
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Entity } from "../entities";
|
||||
// import { Entity } from "../entities";
|
||||
|
||||
// TODO
|
||||
//export const levelFormatToEntityList = (lines: string[]): Entity[] => {
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user