summary refs log tree commit diff stats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/mappable.h4
-rw-r--r--src/components/ponderable.h16
2 files changed, 18 insertions, 2 deletions
diff --git a/src/components/mappable.h b/src/components/mappable.h index 6f3d38e..e92074e 100644 --- a/src/components/mappable.h +++ b/src/components/mappable.h
@@ -7,7 +7,7 @@
7#include <list> 7#include <list>
8#include "component.h" 8#include "component.h"
9#include "renderer/texture.h" 9#include "renderer/texture.h"
10#include "collision.h" 10#include "components/ponderable.h"
11#include "entity_manager.h" 11#include "entity_manager.h"
12 12
13class MappableComponent : public Component { 13class MappableComponent : public Component {
@@ -46,7 +46,7 @@ public:
46 class Boundary { 46 class Boundary {
47 public: 47 public:
48 48
49 using Type = Collision::Type; 49 using Type = PonderableComponent::Collision;
50 50
51 Boundary( 51 Boundary(
52 double axis, 52 double axis,
diff --git a/src/components/ponderable.h b/src/components/ponderable.h index fd7e775..5354f87 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h
@@ -21,6 +21,17 @@ public:
21 }; 21 };
22 22
23 /** 23 /**
24 * List of different types of collidable surfaces.
25 */
26 enum class Collision {
27 wall,
28 platform,
29 adjacency,
30 warp,
31 danger
32 };
33
34 /**
24 * Constructor for initializing the body type, which is a constant. 35 * Constructor for initializing the body type, which is a constant.
25 */ 36 */
26 PonderableComponent(Type type) : type(type) 37 PonderableComponent(Type type) : type(type)
@@ -67,6 +78,11 @@ public:
67 bool collidable = true; 78 bool collidable = true;
68 79
69 /** 80 /**
81 * The effect that colliding with this body has.
82 */
83 Collision colliderType = Collision::wall;
84
85 /**
70 * If this flag is disabled, the entity will be ignored by the pondering 86 * If this flag is disabled, the entity will be ignored by the pondering
71 * system. 87 * system.
72 * 88 *