Skip to content

Commit

Permalink
Merge pull request #282 from JernejHabjan/281-building-collision-not-…
Browse files Browse the repository at this point in the history
…working

#281 Building collision not working
  • Loading branch information
JernejHabjan authored Feb 7, 2025
2 parents 35c6f36 + 5f5b3e5 commit 8cbe62b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Pathfinder_old } from "../../world/map/pathfinder_old";
import { drawDebugPoint } from "../../debug/debug-point";
import { getSceneComponent } from "../components/scene-component-helpers";
import { TilemapComponent } from "../components/tilemap.component";
import { onSceneInitialized } from "../../data/game-object-helper";

export class NavigationService {
private easyStar: EasyStar;
Expand All @@ -22,10 +23,13 @@ export class NavigationService {
private readonly scene: Phaser.Scene,
private readonly tilemap: Phaser.Tilemaps.Tilemap
) {
this.extractTilemapGrid();

onSceneInitialized(scene, this.init, this);
this.scene.events.on("updateNavigation", this.updateNavigation, this);
this.easyStar = new EasyStar();
}

private init() {
this.extractTilemapGrid();

this.updateNavigation();

Expand Down

0 comments on commit 8cbe62b

Please sign in to comment.