transport ship use pathfinding library

This commit is contained in:
evanpelle
2024-11-15 20:43:15 -08:00
committed by Evan
parent c399cb59fb
commit 0b3a92e498
3 changed files with 16 additions and 29 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ export class PathFinder {
private path: Tile[]
private aStar: AStar
constructor() {
constructor(private iterations: number) {
}
@@ -88,7 +88,7 @@ export class PathFinder {
this.dst = dst
this.path = null
this.aStar = new AStar(curr, dst)
if (this.aStar.compute(5000)) {
if (this.aStar.compute(this.iterations)) {
this.path = this.aStar.reconstructPath()
} else {
return null