From 1abc8894c2378596542e5772cd7594492eeecb27 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 6 Feb 2021 13:03:01 -0500 Subject: Added collision with other sprites --- src/transform_system.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/transform_system.h') 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; struct AxisResult { Direction dir; bool blocked = false; + int colliderSprite = -1; }; struct CollisionResult { @@ -54,6 +55,8 @@ private: Collidable(int lower, int upper) : lower(lower), upper(upper) {} }; + // The way these work is that the key is (axis position, entity ID). The + // entity ID being there makes the mapping unique and makes removal easy. using asc_collidables_type = std::map< std::tuple, -- cgit 1.4.1