PowerUp Class Reference

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.

List of all members.

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.

Detailed Description

Defines the physics object that represents a movable powerup object that can be picked up by the paddle.


Member Enumeration Documentation

Defines the differant powerup abilities a pill can have.

Enumerator:
ABILITY_NONE 

The Null ability. Does nothing.

ABILITY_STICKY 

The ball sticks to the paddle when it touches it.

ABILITY_SHRINK 

The paddle will shrink in size.

ABILITY_GROW 

The paddle will grow in size.

ABILITY_EXTRALIFE 

Gains an extra ball.

ABILITY_POINTS 

Grants bonus points.

ABILITY_MULTIPLIER 

Grants a temporary point multiplier.

ABILITY_RANDOM 

Random powerup choosen when the powerup is grabbed.

ABILITY_COUNT 

The number of unique abilites.


Constructor & Destructor Documentation

PowerUp::PowerUp ( Level l,
PhysicsWorld *  w,
const Point2f p 
)

Contructs a powerup pill with a randomly choosen ability.

Parameters:
[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.

Member Function Documentation

PowerUp::Ability PowerUp::GetAbility (  )  const

Gets the ability of the powerup.

Returns:
the powerups ability or ABILITY_NONE if the powerup is is inactive.
virtual PhysicsObjectType PowerUp::GetObjectType (  )  const [inline, virtual]

Returns a type identifier for the PowerUp.

Returns:
POBJ_POWERUP
bool PowerUp::IsActive (  )  const [inline]

Determines if the powerup is active or not.

Returns:
true if the powerup is active, false if the powerup is inactive.
bool PowerUp::Touch ( PhysicsObject *  obj,
const PhysicsCollisionInfo &  hitInfo 
) [virtual]

Called when another physics object collides with a PowerUp.

Parameters:
[in] obj the object that collided with the PowerUp.
[in] hitInfo the hit information for the collision.
Returns:
true if the collision is accepted, false to ignore the collision

NOTE: both objects must return false for a collison to be ignored.


The documentation for this class was generated from the following files:
Generated on Mon Apr 5 19:08:06 2010 for BrickOut |ReDuX| by  doxygen 1.6.3