Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Bomb Class Reference

A bomb in the game that explodes and can hurt players that collide with its blast. More...

#include <Bomb.h>

Inheritance diagram for Bomb:

Entity Drawable HomingBomb ThrownBomb List of all members.

Public Methods

 Bomb (const Rect &initPos, int initDir, float size, float delay)
 Construct a bomb at a specified map location, blast size, and detonation delay.

virtual ~Bomb ()
 Destructor.

virtual bool update (float dt)
 Update the bomb's logic.

virtual void draw (const Point &anchor)
 Draw the bomb on the screen using the specified anchor point.

virtual float getHeight () const
 Returns the current height.

virtual void doCollision (Entity *otherEntity)
 Handles the collision between 2 entities by finding what type of entities they are and then handling the different types of collisions;.


Protected Methods

void blowUp ()
 Tells the bomb to create explosions.

 Bomb ()
 Bomb is not defaultly constructable.


Protected Attributes

float blastSize
 The size of this bomb's explosion.

float explodeTime
 The time at which this bomb explodes.

float height
 The bomb's current height.

int pSoFar
 Number of particles spawned so far.

float timeLived
 Amount of time lived so far.


Detailed Description

A bomb in the game that explodes and can hurt players that collide with its blast.


Constructor & Destructor Documentation

Bomb::Bomb const Rect   initPos,
int    initDir,
float    size,
float    delay
 

Construct a bomb at a specified map location, blast size, and detonation delay.

Parameters:
initPos  the initial map position
initDir  the initial direction
size  the blast size
delay  the detonation delay

Bomb::~Bomb   [virtual]
 

Destructor.

Bomb::Bomb   [protected]
 

Bomb is not defaultly constructable.


Member Function Documentation

void Bomb::blowUp   [protected]
 

Tells the bomb to create explosions.

void Bomb::doCollision Entity   otherEntity [virtual]
 

Handles the collision between 2 entities by finding what type of entities they are and then handling the different types of collisions;.

Parameters:
otherEntity  the entity to check collision with

Reimplemented from Entity.

Reimplemented in ThrownBomb.

void Bomb::draw const Point   anchor [virtual]
 

Draw the bomb on the screen using the specified anchor point.

Parameters:
anchor  the bomb's anchor point

Implements Entity.

Reimplemented in HomingBomb, and ThrownBomb.

float Bomb::getHeight   [virtual]
 

Returns the current height.

Returns:
the current height

Reimplemented from Drawable.

bool Bomb::update float    dt [virtual]
 

Update the bomb's logic.

Parameters:
dt  the amount of time since the last frame
Returns:
true if this bomb has blown up

Implements Entity.

Reimplemented in HomingBomb, and ThrownBomb.


Member Data Documentation

float Bomb::blastSize [protected]
 

The size of this bomb's explosion.

float Bomb::explodeTime [protected]
 

The time at which this bomb explodes.

float Bomb::height [protected]
 

The bomb's current height.

int Bomb::pSoFar [protected]
 

Number of particles spawned so far.

float Bomb::timeLived [protected]
 

Amount of time lived so far.


The documentation for this class was generated from the following files:
Generated on Tue Mar 4 02:29:26 2003 for SuperIsoBomb by doxygen1.2.18