diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-05 20:50:51 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-05 20:50:51 -0500 |
| commit | 1c462ef3780b33468ed93dde3ab6178765807ffe (patch) | |
| tree | 6ee2f34ed3514c10d146c91b0e8e935cf9d1ccb6 /src/sprite.h | |
| parent | 937875c4e1432b418f0f5051759e02c8d4c9ffa4 (diff) | |
| download | tanetane-1c462ef3780b33468ed93dde3ab6178765807ffe.tar.gz tanetane-1c462ef3780b33468ed93dde3ab6178765807ffe.tar.bz2 tanetane-1c462ef3780b33468ed93dde3ab6178765807ffe.zip | |
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.
Diffstat (limited to 'src/sprite.h')
| -rw-r--r-- | src/sprite.h | 10 |
1 files changed, 10 insertions, 0 deletions
| 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 { | |||
| 48 | Path | 48 | Path |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | enum class MirrorType { | ||
| 52 | None, | ||
| 53 | Vertical | ||
| 54 | }; | ||
| 55 | |||
| 51 | struct Movement { | 56 | struct Movement { |
| 52 | vec2i pos; | 57 | vec2i pos; |
| 53 | Direction dir; | 58 | Direction dir; |
| @@ -123,6 +128,11 @@ public: | |||
| 123 | vec2i pathfindingDestination; | 128 | vec2i pathfindingDestination; |
| 124 | bool cardinalDirectionsOnly = false; | 129 | bool cardinalDirectionsOnly = false; |
| 125 | std::deque<PathfindingInstruction> path; | 130 | std::deque<PathfindingInstruction> path; |
| 131 | |||
| 132 | // Mirror | ||
| 133 | MirrorType mirrorType = MirrorType::None; | ||
| 134 | int mirroredSpriteId = -1; | ||
| 135 | int mirrorAxis = 0; | ||
| 126 | }; | 136 | }; |
| 127 | 137 | ||
| 128 | #endif /* end of include guard: SPRITE_H_70503825 */ | 138 | #endif /* end of include guard: SPRITE_H_70503825 */ |
