summary refs log tree commit diff stats
path: root/src/components.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-03-12 22:46:32 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-03-12 22:46:32 -0400
commit47d9d7884c57c2c14dd363b4ccb0df1dcbb5375e (patch)
tree14acad810f6ef199d7fc669fc1abe91972eb7f6a /src/components.h
parentcc75196b1baca28a142e66c69cd51200649d252a (diff)
downloadtherapy-47d9d7884c57c2c14dd363b4ccb0df1dcbb5375e.tar.gz
therapy-47d9d7884c57c2c14dd363b4ccb0df1dcbb5375e.tar.bz2
therapy-47d9d7884c57c2c14dd363b4ccb0df1dcbb5375e.zip
Fixed bug that would prevent player from continuing to move after dying, and also refactored collisions and dying a bit
Diffstat (limited to 'src/components.h')
-rw-r--r--src/components.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/components.h b/src/components.h index f182590..f421529 100644 --- a/src/components.h +++ b/src/components.h
@@ -77,13 +77,22 @@ class MapCollisionComponent : public Component {
77 }; 77 };
78 78
79 struct Collision { 79 struct Collision {
80 enum class Type {
81 wall,
82 wrap,
83 teleport,
84 reverse,
85 platform,
86 danger
87 };
88
80 int axis; 89 int axis;
81 int lower; 90 int lower;
82 int upper; 91 int upper;
83 int type; 92 Type type;
84 }; 93 };
85 94
86 void addCollision(int axis, int lower, int upper, Direction dir, int type); 95 void addCollision(int axis, int lower, int upper, Direction dir, Collision::Type type);
87 bool processCollision(Game& game, Entity& collider, Collision collision, Direction dir); 96 bool processCollision(Game& game, Entity& collider, Collision collision, Direction dir);
88 97
89 std::list<Collision> left_collisions; 98 std::list<Collision> left_collisions;