summaryrefslogtreecommitdiff
path: root/src/engine/components/FacingDirection.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-01 19:45:33 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-01 19:45:33 -0700
commitd08e0105cbc59c6cc804f04aaf1e4e625a13960c (patch)
tree57d5270e146ce2e0c5cfba30e172ab87a2210514 /src/engine/components/FacingDirection.ts
parenta8d07a790395e14fe7aedd3ba638db466f9c0842 (diff)
downloadthe-abstraction-engine-d08e0105cbc59c6cc804f04aaf1e4e625a13960c.tar.gz
the-abstraction-engine-d08e0105cbc59c6cc804f04aaf1e4e625a13960c.zip
eyes follow cursor
Diffstat (limited to 'src/engine/components/FacingDirection.ts')
-rw-r--r--src/engine/components/FacingDirection.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/engine/components/FacingDirection.ts b/src/engine/components/FacingDirection.ts
index a449d21..7108366 100644
--- a/src/engine/components/FacingDirection.ts
+++ b/src/engine/components/FacingDirection.ts
@@ -1,12 +1,18 @@
import { Component, ComponentNames, Sprite } from ".";
-import { type Direction } from "../interfaces";
+import { Direction } from "../interfaces";
export class FacingDirection extends Component {
public readonly directionSprites: Map<Direction, Sprite>;
+ public currentDirection: Direction;
- constructor() {
+ constructor(currentDirection: Direction = Direction.NONE) {
super(ComponentNames.FacingDirection);
+ this.currentDirection = currentDirection;
this.directionSprites = new Map<Direction, Sprite>();
}
+
+ public setDirection(direction: Direction) {
+ this.currentDirection = direction;
+ }
}