diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-11 16:06:19 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2021-03-11 17:33:15 -0500 |
commit | eb9fa5020317a44f17cc4906c4c1c6fe55700d3e (patch) | |
tree | e4cb67d97818e06d974d0fca987dd76f25affdf9 /src/transform_system.h | |
parent | 4c29543e44deb7a327b21b0af6a85a92e83ff103 (diff) | |
download | tanetane-eb9fa5020317a44f17cc4906c4c1c6fe55700d3e.tar.gz tanetane-eb9fa5020317a44f17cc4906c4c1c6fe55700d3e.tar.bz2 tanetane-eb9fa5020317a44f17cc4906c4c1c6fe55700d3e.zip |
Simplified collision detection output
It is no longer split into horizontal and vertical results. Also, the collision detection routine now does the work of calculating an adjusted position, instead of the caller (CharacterSystem) having to do it. This will be useful for #3.
Diffstat (limited to 'src/transform_system.h')
-rw-r--r-- | src/transform_system.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/transform_system.h b/src/transform_system.h index 7fa3423..476b8d8 100644 --- a/src/transform_system.h +++ b/src/transform_system.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <set> | 5 | #include <set> |
6 | #include <map> | 6 | #include <map> |
7 | #include <tuple> | 7 | #include <tuple> |
8 | #include <list> | ||
8 | #include "direction.h" | 9 | #include "direction.h" |
9 | #include "system.h" | 10 | #include "system.h" |
10 | #include "vector.h" | 11 | #include "vector.h" |
@@ -13,15 +14,11 @@ | |||
13 | 14 | ||
14 | class Game; | 15 | class Game; |
15 | 16 | ||
16 | struct AxisResult { | 17 | struct CollisionResult { |
17 | Direction dir; | 18 | Direction dir; |
18 | bool blocked = false; | 19 | bool blocked = false; |
19 | int colliderSprite = -1; | 20 | std::list<int> colliders; |
20 | }; | 21 | vec2i adjustedLoc; |
21 | |||
22 | struct CollisionResult { | ||
23 | AxisResult horiz; | ||
24 | AxisResult vert; | ||
25 | }; | 22 | }; |
26 | 23 | ||
27 | class TransformSystem : public System { | 24 | class TransformSystem : public System { |