Skip to content

Commit 4c1537d

Browse files
committed
refactor: introduce new entity system with runtime and tracked entities
1 parent 087de1a commit 4c1537d

10 files changed

Lines changed: 818 additions & 178 deletions

File tree

src/GameScene.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Phaser from "phaser";
22
import { COLORS, PLAYER_CONFIG, PLAYER_GEOMETRY, VIEWPORT, WORLD } from "./constants";
33
import { EntityWorld, spikeTriangles } from "./entities/EntityWorld";
4-
import { RefillEntity, RefillType } from "./entities/types";
4+
import { type RefillPickupEntity } from "./entities/runtime";
5+
import { RefillType } from "./entities/types";
56
import { TILE_JUMP_THROUGH, tileAt } from "./grid";
67
import { parseLevel } from "./level";
78
import { PlayerControls } from "./input/PlayerControls";
@@ -11,7 +12,7 @@ import { InputState, PlayerEffect } from "./player/types";
1112
import { PlayerView } from "./view/PlayerView";
1213

1314
interface RefillView {
14-
entity: RefillEntity;
15+
entity: RefillPickupEntity;
1516
glow: Phaser.GameObjects.Ellipse;
1617
body: Phaser.GameObjects.Rectangle;
1718
}
@@ -561,7 +562,7 @@ export class GameScene extends Phaser.Scene {
561562
}
562563
}
563564

564-
private createRefills(spawns: ReadonlyArray<RefillEntity>): void {
565+
private createRefills(spawns: ReadonlyArray<RefillPickupEntity>): void {
565566
for (const spawn of spawns) {
566567
const color = this.refillColor(spawn.type);
567568
const glow = this.add

0 commit comments

Comments
 (0)