diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-20 13:19:15 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-20 13:19:15 -0500 |
commit | ca4935cb65325edbd45d4a3aacc921ea9ed9483b (patch) | |
tree | 28376ffac0f817fc3f1f7290745e91d603fd59e8 /src/map.h | |
parent | 996076cf151a27a7a8d278aa4d15b28cfb196c46 (diff) | |
download | tanetane-ca4935cb65325edbd45d4a3aacc921ea9ed9483b.tar.gz tanetane-ca4935cb65325edbd45d4a3aacc921ea9ed9483b.tar.bz2 tanetane-ca4935cb65325edbd45d4a3aacc921ea9ed9483b.zip |
Added enclosure zones
A sprite with an enclosure zone will collide with it if it attempts to leave the area defined by the zone. This is used to make sure that wandering sprites don't end up in weird places.
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h index c5ecc64..e4096f4 100644 --- a/src/map.h +++ b/src/map.h | |||
@@ -25,6 +25,7 @@ struct Prototype { | |||
25 | std::string interactionScript; | 25 | std::string interactionScript; |
26 | bool shadow = false; | 26 | bool shadow = false; |
27 | bool wander = false; | 27 | bool wander = false; |
28 | std::string enclosureZone; | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | struct Trigger { | 31 | struct Trigger { |
@@ -34,6 +35,11 @@ struct Trigger { | |||
34 | std::string script; | 35 | std::string script; |
35 | }; | 36 | }; |
36 | 37 | ||
38 | struct Zone { | ||
39 | vec2i ul; | ||
40 | vec2i dr; | ||
41 | }; | ||
42 | |||
37 | class Map { | 43 | class Map { |
38 | public: | 44 | public: |
39 | 45 | ||
@@ -61,6 +67,8 @@ public: | |||
61 | 67 | ||
62 | const std::vector<Trigger>& getTriggers() const { return triggers_; } | 68 | const std::vector<Trigger>& getTriggers() const { return triggers_; } |
63 | 69 | ||
70 | const Zone& getZone(const std::string& name) const { return zones_.at(name); } | ||
71 | |||
64 | private: | 72 | private: |
65 | 73 | ||
66 | std::string name_; | 74 | std::string name_; |
@@ -72,6 +80,7 @@ private: | |||
72 | std::vector<Prototype> prototypes_; | 80 | std::vector<Prototype> prototypes_; |
73 | std::map<std::string, vec2i> warpPoints_; | 81 | std::map<std::string, vec2i> warpPoints_; |
74 | std::vector<Trigger> triggers_; | 82 | std::vector<Trigger> triggers_; |
83 | std::map<std::string, Zone> zones_; | ||
75 | }; | 84 | }; |
76 | 85 | ||
77 | #endif /* end of include guard: MAP_H_D95D6D47 */ | 86 | #endif /* end of include guard: MAP_H_D95D6D47 */ |