summary refs log tree commit diff stats
path: root/src/sprite.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-27 17:40:26 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-27 17:40:26 -0500
commite03683852cac9b31ca846fcf13ff53abf99232c7 (patch)
tree4f18e4f6d033547f8bf9210ff8466406ed6dbd49 /src/sprite.h
parent4be70b7d55493cdc2d5e909d5101e70a16bee6f1 (diff)
downloadtanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.gz
tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.bz2
tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.zip
Added A* pathfinding
Diffstat (limited to 'src/sprite.h')
-rw-r--r--src/sprite.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/sprite.h b/src/sprite.h index 733c792..13d0383 100644 --- a/src/sprite.h +++ b/src/sprite.h
@@ -40,12 +40,23 @@ enum class CharacterMedium {
40 Water 40 Water
41}; 41};
42 42
43enum class BehaviourType {
44 None,
45 Wander,
46 Path
47};
48
43struct Movement { 49struct Movement {
44 vec2i pos; 50 vec2i pos;
45 Direction dir; 51 Direction dir;
46 CharacterMedium medium; 52 CharacterMedium medium;
47}; 53};
48 54
55struct PathfindingInstruction {
56 Direction dir;
57 vec2i endpoint;
58};
59
49class Sprite { 60class Sprite {
50public: 61public:
51 62
@@ -106,7 +117,10 @@ public:
106 bool player = false; 117 bool player = false;
107 118
108 // Behaviour 119 // Behaviour
109 bool wander = false; 120 BehaviourType behaviourType = BehaviourType::None;
121 vec2i pathfindingDestination;
122 bool cardinalDirectionsOnly = false;
123 std::deque<PathfindingInstruction> path;
110}; 124};
111 125
112#endif /* end of include guard: SPRITE_H_70503825 */ 126#endif /* end of include guard: SPRITE_H_70503825 */