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/map.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index 8d0ada6..32203e5 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -111,6 +111,14 @@ Map::Map(std::string_view name) : name_(name) { p.enclosureZone = property.getStringValue(); } else if (property.getName() == "movementSpeed") { p.movementSpeed = property.getIntValue(); + } else if (property.getName() == "mirror") { + if (property.getStringValue() == "vertical") { + p.mirrorType = MirrorType::Vertical; + } + } else if (property.getName() == "mirrorAxis") { + p.mirrorAxis = property.getIntValue(); + } else if (property.getName() == "mirrorSprite") { + p.spriteToMirror = property.getStringValue(); } } -- cgit 1.4.1