diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-06 13:03:01 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-06 13:03:01 -0500 |
commit | 1abc8894c2378596542e5772cd7594492eeecb27 (patch) | |
tree | c905dc3c96ff7b1d64aaf3212214f0731305bf82 /src/transform_system.h | |
parent | 4526d347961f7a5df110ef94bd38b80008e3110d (diff) | |
download | tanetane-1abc8894c2378596542e5772cd7594492eeecb27.tar.gz tanetane-1abc8894c2378596542e5772cd7594492eeecb27.tar.bz2 tanetane-1abc8894c2378596542e5772cd7594492eeecb27.zip |
Added collision with other sprites
Diffstat (limited to 'src/transform_system.h')
-rw-r--r-- | src/transform_system.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/transform_system.h b/src/transform_system.h index 1ad661c..a7294ce 100644 --- a/src/transform_system.h +++ b/src/transform_system.h | |||
@@ -14,6 +14,7 @@ class Game; | |||
14 | struct AxisResult { | 14 | struct AxisResult { |
15 | Direction dir; | 15 | Direction dir; |
16 | bool blocked = false; | 16 | bool blocked = false; |
17 | int colliderSprite = -1; | ||
17 | }; | 18 | }; |
18 | 19 | ||
19 | struct CollisionResult { | 20 | struct CollisionResult { |
@@ -54,6 +55,8 @@ private: | |||
54 | Collidable(int lower, int upper) : lower(lower), upper(upper) {} | 55 | Collidable(int lower, int upper) : lower(lower), upper(upper) {} |
55 | }; | 56 | }; |
56 | 57 | ||
58 | // The way these work is that the key is (axis position, entity ID). The | ||
59 | // entity ID being there makes the mapping unique and makes removal easy. | ||
57 | using asc_collidables_type = | 60 | using asc_collidables_type = |
58 | std::map< | 61 | std::map< |
59 | std::tuple<int, int>, | 62 | std::tuple<int, int>, |