summaryrefslogtreecommitdiff
path: root/src/engine/systems/Input.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-11 16:35:51 -0600
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-11 16:35:51 -0600
commitde4f3fd2fe45478ffabc84f055592e11b119d0a4 (patch)
treead2ce3b3e646d2d6bfbccb4b9c8962196a0ea8fe /src/engine/systems/Input.ts
parent32879581e53fae5e684c24b44433172d8375d69e (diff)
downloadthe-abstraction-engine-de4f3fd2fe45478ffabc84f055592e11b119d0a4.tar.gz
the-abstraction-engine-de4f3fd2fe45478ffabc84f055592e11b119d0a4.zip
prettier, fix assets and css
Diffstat (limited to 'src/engine/systems/Input.ts')
-rw-r--r--src/engine/systems/Input.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/engine/systems/Input.ts b/src/engine/systems/Input.ts
index 9199c89..c527f29 100644
--- a/src/engine/systems/Input.ts
+++ b/src/engine/systems/Input.ts
@@ -32,20 +32,20 @@ export class Input extends System {
public update(_dt: number, game: Game) {
game.forEachEntityWithComponent(ComponentNames.Control, (entity) =>
- this.handleMovement(entity, game)
+ this.handleMovement(entity, game),
);
game.forEachEntityWithComponent(ComponentNames.Interactable, (entity) =>
- this.handleInteraction(entity)
+ this.handleInteraction(entity),
);
}
private handleInteraction(entity: Entity) {
const interactable = entity.getComponent<Interactable>(
- ComponentNames.Interactable
+ ComponentNames.Interactable,
);
const interact = this.hasSomeKey(
- KeyConstants.ActionKeys.get(Action.INTERACT)
+ KeyConstants.ActionKeys.get(Action.INTERACT),
);
if (!interact) {
@@ -54,13 +54,13 @@ export class Input extends System {
interactable.interact();
KeyConstants.ActionKeys.get(Action.INTERACT)!.forEach((key) =>
- this.keyReleased(key)
+ this.keyReleased(key),
);
}
public handleMovement(entity: Entity, game: Game) {
const controlComponent = entity.getComponent<Control>(
- ComponentNames.Control
+ ComponentNames.Control,
);
if (!controlComponent.isControllable) return;
@@ -85,22 +85,22 @@ export class Input extends System {
if (moveUp) {
gridComponent.movingDirection = Direction.UP;
KeyConstants.ActionKeys.get(Action.MOVE_UP)!.forEach((key) =>
- this.keyReleased(key)
+ this.keyReleased(key),
);
} else if (moveLeft) {
gridComponent.movingDirection = Direction.LEFT;
KeyConstants.ActionKeys.get(Action.MOVE_LEFT)!.forEach((key) =>
- this.keyReleased(key)
+ this.keyReleased(key),
);
} else if (moveRight) {
gridComponent.movingDirection = Direction.RIGHT;
KeyConstants.ActionKeys.get(Action.MOVE_RIGHT)!.forEach((key) =>
- this.keyReleased(key)
+ this.keyReleased(key),
);
} else if (moveDown) {
gridComponent.movingDirection = Direction.DOWN;
KeyConstants.ActionKeys.get(Action.MOVE_DOWN)!.forEach((key) =>
- this.keyReleased(key)
+ this.keyReleased(key),
);
}