summaryrefslogtreecommitdiff
path: root/src/engine/systems/Input.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth@simponic.xyz>2025-03-01 13:10:21 -0700
committerElizabeth Hunt <elizabeth@simponic.xyz>2025-03-01 13:10:21 -0700
commit309ed20627ed798c464a9f97d9c32ceb1a314595 (patch)
treeb98d7ec6f6dd3eb3bcc4eaaaf76035ad9a2671a0 /src/engine/systems/Input.ts
parent8dacee8f73633131fd68935c1e2493dc4beec837 (diff)
downloadthe-abstraction-engine-309ed20627ed798c464a9f97d9c32ceb1a314595.tar.gz
the-abstraction-engine-309ed20627ed798c464a9f97d9c32ceb1a314595.zip
add a reset button!
Diffstat (limited to 'src/engine/systems/Input.ts')
-rw-r--r--src/engine/systems/Input.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/engine/systems/Input.ts b/src/engine/systems/Input.ts
index c527f29..b11ba84 100644
--- a/src/engine/systems/Input.ts
+++ b/src/engine/systems/Input.ts
@@ -1,4 +1,4 @@
-import { Grid as GridSystem, SystemNames, System } from ".";
+import { Grid as GridSystem, SystemNames, System, Level } from ".";
import { Game } from "..";
import { ComponentNames, Grid, Interactable } from "../components";
import { Control } from "../components/Control";
@@ -31,6 +31,10 @@ export class Input extends System {
}
public update(_dt: number, game: Game) {
+ if (this.hasSomeKey(KeyConstants.ActionKeys.get(Action.RESET))) {
+ game.getSystem<Level>(SystemNames.Level).reset(game);
+ }
+
game.forEachEntityWithComponent(ComponentNames.Control, (entity) =>
this.handleMovement(entity, game),
);