From c3242b171cdbb36a26fda04c7148b9b40a5f5c33 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Fri, 1 Mar 2024 21:29:40 -0700 Subject: player movement --- src/engine/components/Grid.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/engine/components/Grid.ts (limited to 'src/engine/components/Grid.ts') diff --git a/src/engine/components/Grid.ts b/src/engine/components/Grid.ts new file mode 100644 index 0000000..0c18a65 --- /dev/null +++ b/src/engine/components/Grid.ts @@ -0,0 +1,20 @@ +import { Component, ComponentNames } from "."; +import { Coord2D, Direction } from "../interfaces"; + +export class Grid extends Component { + public initialized: boolean; + + public gridPosition: Coord2D; + public movingDirection: Direction; + public pushable: boolean = false; + + constructor(pushable: boolean = false, position: Coord2D = { x: 0, y: 0 }) { + super(ComponentNames.Grid); + + this.initialized = false; + + this.gridPosition = position; + this.movingDirection = Direction.NONE; + this.pushable = pushable; + } +} -- cgit v1.2.3-70-g09d2