summaryrefslogtreecommitdiff
path: root/src/engine/TheAbstractionEngine.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-01 21:29:40 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-01 21:29:40 -0700
commitc3242b171cdbb36a26fda04c7148b9b40a5f5c33 (patch)
tree5060cb6d34e01f36687c0ce79e5ae0b1b8767e63 /src/engine/TheAbstractionEngine.ts
parentd08e0105cbc59c6cc804f04aaf1e4e625a13960c (diff)
downloadthe-abstraction-engine-c3242b171cdbb36a26fda04c7148b9b40a5f5c33.tar.gz
the-abstraction-engine-c3242b171cdbb36a26fda04c7148b9b40a5f5c33.zip
player movement
Diffstat (limited to 'src/engine/TheAbstractionEngine.ts')
-rw-r--r--src/engine/TheAbstractionEngine.ts18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/engine/TheAbstractionEngine.ts b/src/engine/TheAbstractionEngine.ts
index 76ca7e9..094555b 100644
--- a/src/engine/TheAbstractionEngine.ts
+++ b/src/engine/TheAbstractionEngine.ts
@@ -1,7 +1,8 @@
import { Game } from ".";
-import { loadAssets } from "./config";
+import { Miscellaneous, loadAssets } from "./config";
import { Player } from "./entities";
import { FacingDirection, Input, Render } from "./systems";
+import { Grid } from "./systems/Grid";
export class TheAbstractionEngine {
private game: Game;
@@ -22,9 +23,18 @@ export class TheAbstractionEngine {
const facingDirectionSystem = new FacingDirection(inputSystem);
- [new Render(this.ctx), inputSystem, facingDirectionSystem].forEach(
- (system) => this.game.addSystem(system),
- );
+ [
+ new Render(this.ctx),
+ inputSystem,
+ facingDirectionSystem,
+ new Grid(
+ { width: Miscellaneous.GRID_COLUMNS, height: Miscellaneous.GRID_ROWS },
+ {
+ width: Miscellaneous.GRID_CELL_WIDTH,
+ height: Miscellaneous.GRID_CELL_HEIGHT,
+ },
+ ),
+ ].forEach((system) => this.game.addSystem(system));
const player = new Player();
this.game.addEntity(player);