From 315ca2fb388f790791c9ce372cf44e00d51e0e7f Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 9 Feb 2021 20:34:59 -0500 Subject: Added trigger zones to the map Walking into a trigger zone runs a script. --- src/map.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 7bfb15e..4c5d6d4 100644 --- a/src/map.h +++ b/src/map.h @@ -28,6 +28,13 @@ struct Prototype { std::string interactionScript; }; +struct Trigger { + std::string name; + vec2i pos; + vec2i size; + std::string script; +}; + class Map { public: @@ -51,6 +58,8 @@ public: const vec2i& getWarpPoint(const std::string& name) const { return warpPoints_.at(name); } + const std::vector& getTriggers() const { return triggers_; } + private: vec2i mapSize_; @@ -60,6 +69,7 @@ private: int tilesetColumns_; std::vector prototypes_; std::map warpPoints_; + std::vector triggers_; }; #endif /* end of include guard: MAP_H_D95D6D47 */ -- cgit 1.4.1