#include <hurting_platform.hpp>
Inherits Platform.
Public Member Functions | |
HurtingPlatform (const Reader &reader) | |
virtual HitResponse | collision (GameObject &other, const CollisionHit &hit) |
this function is called when the object collided with any other object |
Definition at line 25 of file hurting_platform.hpp.
HurtingPlatform::HurtingPlatform | ( | const Reader & | reader | ) |
Definition at line 23 of file hurting_platform.cpp.
References COLGROUP_TOUCHABLE, and MovingObject::set_group().
00024 : Platform(reader) 00025 { 00026 set_group(COLGROUP_TOUCHABLE); 00027 }
HitResponse HurtingPlatform::collision | ( | GameObject & | other, | |
const CollisionHit & | hit | |||
) | [virtual] |
this function is called when the object collided with any other object
Reimplemented from Platform.
Definition at line 30 of file hurting_platform.cpp.
References ABORT_MOVE, FORCE_MOVE, Player::is_invincible(), Player::kill(), and BadGuy::kill_fall().
00031 { 00032 Player* player = dynamic_cast<Player*>(&other); 00033 if (player) { 00034 if(player->is_invincible()) { 00035 return ABORT_MOVE; 00036 } 00037 player->kill(false); 00038 } 00039 BadGuy* badguy = dynamic_cast<BadGuy*>(&other); 00040 if (badguy) { 00041 badguy->kill_fall(); 00042 } 00043 00044 return FORCE_MOVE; 00045 }