From 1c462ef3780b33468ed93dde3ab6178765807ffe Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 5 Mar 2021 20:50:51 -0500 Subject: Added MirrorSystem This is really just for letting one sprite mirror another's movement and animation. I tried doing it in the BehaviourSystem, but you get stuttering if you do it earlier in the loop than the CharacterSystem, so I ended up having to make a new system just for this thing that will not happen very often. --- src/sprite.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sprite.h') diff --git a/src/sprite.h b/src/sprite.h index 6538c1d..2ab306d 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -48,6 +48,11 @@ enum class BehaviourType { Path }; +enum class MirrorType { + None, + Vertical +}; + struct Movement { vec2i pos; Direction dir; @@ -123,6 +128,11 @@ public: vec2i pathfindingDestination; bool cardinalDirectionsOnly = false; std::deque path; + + // Mirror + MirrorType mirrorType = MirrorType::None; + int mirroredSpriteId = -1; + int mirrorAxis = 0; }; #endif /* end of include guard: SPRITE_H_70503825 */ -- cgit 1.4.1