Needed to rewrite the pathing to get this to work. I actually had been using a purposefully broken pathing algorithm from when I was making random maps.

This commit is contained in:
Zed A. Shaw 2025-08-30 10:48:52 -04:00
parent c894f6e094
commit e92fd2b6f3
10 changed files with 169 additions and 111 deletions

View file

@ -7,7 +7,12 @@ using matrix::Matrix;
constexpr const int PATHING_TOWARD=1;
constexpr const int PATHING_AWAY=-1;
constexpr const int DIRECTION_MAX=8;
enum class PathingResult {
FAIL=0,
FOUND=1,
CONTINUE=2
};
class Pathing {
public:
@ -29,8 +34,7 @@ public:
Matrix &paths() { return $paths; }
Matrix &input() { return $input; }
int distance(Point to) { return $paths[to.y][to.x];}
bool random_walk(Point &out, bool random, int direction,
size_t slice_count=4, size_t dist_size=4);
PathingResult find_path(Point &out, int direction, bool diag);
bool INVARIANT();
};