From e03683852cac9b31ca846fcf13ff53abf99232c7 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 27 Feb 2021 17:40:26 -0500 Subject: Added A* pathfinding --- src/behaviour_system.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/behaviour_system.h') diff --git a/src/behaviour_system.h b/src/behaviour_system.h index 0eb4772..526a09b 100644 --- a/src/behaviour_system.h +++ b/src/behaviour_system.h @@ -3,6 +3,12 @@ #include "system.h" #include "timer.h" +#include "vector.h" + +enum class PathfindingOptions { + None = 0, + CardinalDirectionsOnly = 1 << 0 +}; class Game; @@ -15,8 +21,14 @@ public: void tick(double dt) override; + void directSpriteToLocation(int spriteId, vec2i pos, PathfindingOptions options = PathfindingOptions::None); + + bool isFollowingPath(int spriteId); + private: + void createPath(int spriteId); + Game& game_; Timer timer_ { 500 }; }; -- cgit 1.4.1