summary refs log tree commit diff stats
path: root/src/transform_system.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-03-11 16:06:19 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2021-03-11 17:33:15 -0500
commiteb9fa5020317a44f17cc4906c4c1c6fe55700d3e (patch)
treee4cb67d97818e06d974d0fca987dd76f25affdf9 /src/transform_system.h
parent4c29543e44deb7a327b21b0af6a85a92e83ff103 (diff)
downloadtanetane-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.h11
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
14class Game; 15class Game;
15 16
16struct AxisResult { 17struct 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
22struct CollisionResult {
23 AxisResult horiz;
24 AxisResult vert;
25}; 22};
26 23
27class TransformSystem : public System { 24class TransformSystem : public System {