summaryrefslogtreecommitdiff
path: root/engine/entities/Floor.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-08-12 13:49:16 -0600
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-08-12 13:49:16 -0600
commitc6e9baa0009f7cce0f6ff156a3957ef04a8cb684 (patch)
tree9766a4a33ad1c86aa71a5f92daf8917f3e5f5eed /engine/entities/Floor.ts
parentb67ffb57c1bf6e9628339a3f43c71ccebdb46136 (diff)
downloadjumpstorm-c6e9baa0009f7cce0f6ff156a3957ef04a8cb684.tar.gz
jumpstorm-c6e9baa0009f7cce0f6ff156a3957ef04a8cb684.zip
the great engine refactor
Diffstat (limited to 'engine/entities/Floor.ts')
-rw-r--r--engine/entities/Floor.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/engine/entities/Floor.ts b/engine/entities/Floor.ts
index d51badc..44587e6 100644
--- a/engine/entities/Floor.ts
+++ b/engine/entities/Floor.ts
@@ -4,26 +4,28 @@ import { TopCollidable } from "../components/TopCollidable";
import { Entity } from "../entities";
export class Floor extends Entity {
- private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(Sprites.FLOOR);
+ private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
+ Sprites.FLOOR,
+ ) as SpriteSpec;
constructor(width: number) {
super();
this.addComponent(
new Sprite(
- IMAGES.get(Floor.spriteSpec.states[width].sheet),
+ IMAGES.get((Floor.spriteSpec?.states?.get(width) as SpriteSpec).sheet),
{ x: 0, y: 0 },
{ width, height: Floor.spriteSpec.height },
Floor.spriteSpec.msPerFrame,
- Floor.spriteSpec.frames
- )
+ Floor.spriteSpec.frames,
+ ),
);
this.addComponent(
new BoundingBox(
{ x: 300, y: 300 },
- { width, height: Floor.spriteSpec.height }
- )
+ { width, height: Floor.spriteSpec.height },
+ ),
);
this.addComponent(new TopCollidable());