Rally X
ELEN3009 Project by Justin Wernick and David Schneider
|
Parent class for GameObjects that are created, exist for a given time, and are then destroyed. More...
#include <LimitedTimeObject.h>
Public Member Functions | |
LimitedTimeObject (double x, double y, BitmapStore::Image image, int time) | |
Creates a LimitedTimeObject with the given parameters. | |
void | update () |
Function that should be run on every iteration of the gameloop. | |
Private Attributes | |
int | _remainingTime |
The number of times that update still needs to be run before the object is marked for destruction. |
Parent class for GameObjects that are created, exist for a given time, and are then destroyed.
Definition at line 14 of file LimitedTimeObject.h.
LimitedTimeObject::LimitedTimeObject | ( | double | x, |
double | y, | ||
BitmapStore::Image | image, | ||
int | time | ||
) |
Creates a LimitedTimeObject with the given parameters.
[in] | x | The x coordinate of the new object. |
[in] | y | The y coordinate of the new object. |
[in] | image | The image that is drawn to represent the object. |
[in] | time | The number of times that the update function is run before the object is destroyed. |
Definition at line 3 of file LimitedTimeObject.cpp.
void LimitedTimeObject::update | ( | ) |
Function that should be run on every iteration of the gameloop.
The time remaining is decremented, and the object is marked for destruction when it reaches zero.
Definition at line 9 of file LimitedTimeObject.cpp.
int LimitedTimeObject::_remainingTime [private] |
The number of times that update still needs to be run before the object is marked for destruction.
For example, if the remaining time is 1, then the object is marked on the next update.
Definition at line 42 of file LimitedTimeObject.h.