Defines the physics object that represents a movable powerup object that can be picked up by the paddle. More...
#include <Game/PowerUp.h>
Inherits PhysicsObject.
Public Types | |
enum | Ability { ABILITY_NONE = -1, ABILITY_STICKY = 0, ABILITY_SHRINK, ABILITY_GROW, ABILITY_EXTRALIFE, ABILITY_POINTS, ABILITY_MULTIPLIER, ABILITY_RANDOM, ABILITY_COUNT } |
Defines the differant powerup abilities a pill can have. More... | |
Public Member Functions | |
PowerUp (Level *l, PhysicsWorld *w, const Point2f &p) | |
Contructs a powerup pill with a randomly choosen ability. | |
virtual | ~PowerUp () |
Deconstructor. | |
virtual bool | Touch (PhysicsObject *obj, const PhysicsCollisionInfo &hitInfo) |
Called when another physics object collides with a PowerUp. | |
virtual PhysicsObjectType | GetObjectType () const |
Returns a type identifier for the PowerUp. | |
bool | IsActive () const |
Determines if the powerup is active or not. | |
void | Deactivate () |
Deactiveates the powerup. | |
Ability | GetAbility () const |
Gets the ability of the powerup. | |
void | Draw () |
Draws the powerup. |
Defines the physics object that represents a movable powerup object that can be picked up by the paddle.
enum PowerUp::Ability |
Defines the differant powerup abilities a pill can have.
Contructs a powerup pill with a randomly choosen ability.
[in] | l | the level the powerup belongs to. |
[in] | w | the physics world he powerup resides in. |
[in] | p | the position to create the powerup. |
PowerUp::Ability PowerUp::GetAbility | ( | ) | const |
Gets the ability of the powerup.
virtual PhysicsObjectType PowerUp::GetObjectType | ( | ) | const [inline, virtual] |
Returns a type identifier for the PowerUp.
bool PowerUp::IsActive | ( | ) | const [inline] |
Determines if the powerup is active or not.
bool PowerUp::Touch | ( | PhysicsObject * | obj, | |
const PhysicsCollisionInfo & | hitInfo | |||
) | [virtual] |
Called when another physics object collides with a PowerUp.
[in] | obj | the object that collided with the PowerUp. |
[in] | hitInfo | the hit information for the collision. |
NOTE: both objects must return false for a collison to be ignored.