summaryrefslogtreecommitdiff
path: root/cObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'cObject.h')
-rw-r--r--cObject.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/cObject.h b/cObject.h
index d0947da..50b9d18 100644
--- a/cObject.h
+++ b/cObject.h
@@ -3,8 +3,12 @@
#include "cRender.h"
-struct sObject
+#define _HIT_TOP 1
+#define _HIT_BOTTOM 2
+#define _HIT_LEFT 3
+#define _HIT_RIGHT 4
+struct sObject
{
sPos pos;
WORD **wColor;
@@ -60,6 +64,20 @@ public:
*/
virtual void onChar(unsigned char _c){}
+
+ /** Called by cObjectHandler if Object hits another during move operation
+ * return true to abort move, false to continue and allow overlap
+ */
+ virtual bool onCollisionActive(unsigned int _hit, int _passiveObject) { return false; }
+
+ /** Called by cObjectHandler if Object is hit by another object
+ * return any integer value to be identified by hitting object
+ */
+ virtual int onCollisionPassive(unsigned int _hit) { return 0; }
+
+
+
+
protected: //For child classes
cObject();
/** For inheriting classes: sets size of framebuffer