SuperTuxKart
Loading...
Searching...
No Matches
explosion.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2004-2015 Steve Baker <sjbaker1@airmail.net>
4// Copyright (C) 2014-2015 SuperTuxKart-Team
5//
6// This program is free software; you can redistribute it and/or
7// modify it under the terms of the GNU General Public License
8// as published by the Free Software Foundation; either version 3
9// of the License, or (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20#ifndef HEADER_EXPLOSION_HPP
21#define HEADER_EXPLOSION_HPP
22
23#include "graphics/hit_sfx.hpp"
24#include "utils/cpp2011.hpp"
25#include "utils/no_copy.hpp"
26
27namespace irr
28{
29 namespace scene { class IParticleSystemSceneNode; }
30}
31using namespace irr;
32
33class Vec3;
34class SFXBase;
35class ParticleEmitter;
36
40class Explosion : public HitSFX
41{
42private:
43 int m_remaining_ticks;
44 int m_emission_frames;
45 ParticleEmitter* m_emitter;
46 int m_explosion_ticks;
47
48
49public:
50 Explosion(const Vec3& coord, const char* explosion_sound, const char * particle_file );
51 ~Explosion();
52 bool updateAndDelete(int ticks) OVERRIDE;
53 bool hasEnded ()
54 {
55 return m_remaining_ticks <= -m_explosion_ticks;
56 }
57
58} ;
59
60#endif
61
62/* EOF */
Definition: explosion.hpp:41
bool updateAndDelete(int ticks) OVERRIDE
Updates the explosion, called one per time step.
Definition: explosion.cpp:89
~Explosion()
Destructor stops the explosion sfx from being played and frees its memory.
Definition: explosion.cpp:74
Definition: hit_sfx.hpp:31
manages smoke particle effects
Definition: particle_emitter.hpp:42
The base class for sound effects.
Definition: sfx_base.hpp:43
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35