HurtingPlatform Class Reference

Platform that hurts Tux and Badguys when touched. More...

#include <hurting_platform.hpp>

Inherits Platform.

List of all members.

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


Detailed Description

Platform that hurts Tux and Badguys when touched.

Definition at line 25 of file hurting_platform.hpp.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 9 03:38:31 2014 for SuperTux by  doxygen 1.5.1