diff options
Diffstat (limited to 'cObject.h')
-rw-r--r-- | cObject.h | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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 |