OpenXcom
1.0
Open-source clone of the original X-Com
|
A class that represents an explosion animation. More...
#include <Explosion.h>
Public Member Functions | |
Explosion (Position _position, int startFrame, bool big, bool hit=false) | |
Creates a new Explosion. More... | |
~Explosion () | |
Cleans up the Explosion. More... | |
bool | animate () |
Moves the Explosion on one frame. More... | |
Position | getPosition () const |
Gets the current position in voxel space. More... | |
int | getCurrentFrame () const |
Gets the current frame. More... | |
bool | isBig () const |
Checks if this is a real explosion. More... | |
bool | isHit () const |
Checks if this is a melee or psi hit. More... | |
A class that represents an explosion animation.
Map is the owner of an instance of this class during its short life. It represents both a bullet hit, as a real explosion animation.
OpenXcom::Explosion::Explosion | ( | Position | position, |
int | startFrame, | ||
bool | big, | ||
bool | hit = false |
||
) |
Creates a new Explosion.
Sets up a Explosion sprite with the specified size and position.
position | Explosion center position in voxel x/y/z. |
startFrame | A startframe - can be used to offset different explosions at different frames. |
big | Flag to indicate it is a bullet hit (false), or a real explosion (true). |
hit | True for melee and psi attacks. |
bool OpenXcom::Explosion::animate | ( | ) |
Moves the Explosion on one frame.
Animates the explosion further.
int OpenXcom::Explosion::getCurrentFrame | ( | ) | const |
Gets the current frame.
Gets the current frame in the animation.
Position OpenXcom::Explosion::getPosition | ( | ) | const |
Gets the current position in voxel space.
bool OpenXcom::Explosion::isBig | ( | ) | const |
Checks if this is a real explosion.
Returns flag to indicate if it is a bullet hit (false), or a real explosion (true).
bool OpenXcom::Explosion::isHit | ( | ) | const |
Checks if this is a melee or psi hit.
Returns flag to indicate if it is a melee or psi hit.