| Line | |
|---|
| 1 | /*! |
|---|
| 2 | * @file explosion.h |
|---|
| 3 | * @brief a Explosion Projectile |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | #ifndef _EXPLOSION_H |
|---|
| 7 | #define _EXPLOSION_H |
|---|
| 8 | |
|---|
| 9 | #include "world_entity.h" |
|---|
| 10 | #include "sound_source.h" |
|---|
| 11 | #include "sound_buffer.h" |
|---|
| 12 | #include "sound/resource_sound_buffer.h" |
|---|
| 13 | |
|---|
| 14 | class SpriteParticles; |
|---|
| 15 | class BoxEmitter; |
|---|
| 16 | class FastFactory; |
|---|
| 17 | |
|---|
| 18 | class Explosion : public WorldEntity |
|---|
| 19 | { |
|---|
| 20 | ObjectListDeclaration(Explosion); |
|---|
| 21 | public: |
|---|
| 22 | static void explode (PNode* position, const Vector& size); |
|---|
| 23 | void explode (float x, float y, float z); /// Explode at the current position with size (x,y,z) |
|---|
| 24 | void setExplosionSound(const std::string& newExplosionSound){ this->explosionSoundBuffer = OrxSound::ResourceSoundBuffer(newExplosionSound); } |
|---|
| 25 | void playSound(); |
|---|
| 26 | |
|---|
| 27 | Explosion (); |
|---|
| 28 | virtual ~Explosion (); |
|---|
| 29 | |
|---|
| 30 | virtual void activate(); |
|---|
| 31 | virtual void deactivate(); |
|---|
| 32 | |
|---|
| 33 | virtual void tick (float time); |
|---|
| 34 | |
|---|
| 35 | void setLifeTime( float lifeTime ){ this->lifeTime = lifeTime; } |
|---|
| 36 | |
|---|
| 37 | protected: |
|---|
| 38 | static FastFactory* fastFactory; |
|---|
| 39 | |
|---|
| 40 | float lifeTime; |
|---|
| 41 | float lifeCycle; |
|---|
| 42 | |
|---|
| 43 | static SpriteParticles* explosionParticles; |
|---|
| 44 | BoxEmitter* emitter; |
|---|
| 45 | |
|---|
| 46 | OrxSound::SoundSource explosionSound; |
|---|
| 47 | OrxSound::SoundBuffer explosionSoundBuffer; |
|---|
| 48 | }; |
|---|
| 49 | |
|---|
| 50 | #endif /* _EXPLOSION_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.