forked from snoutmate/Sea-Defender
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfx_missile_expl.cpp
More file actions
50 lines (37 loc) · 791 Bytes
/
fx_missile_expl.cpp
File metadata and controls
50 lines (37 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "fx_missile_expl.h"
#include "pe_bubble_expl.h"
#include "snoutlib/timer.h"
FX_Missile_Explosion::FX_Missile_Explosion(const vec2& pos) :
m_pos(pos)
{
m_bubble_expl = new PE_Bubble_Explosion(m_pos);
m_start_time = g_timer->now();
m_duration = 1.0;
m_running = true;
}
FX_Missile_Explosion::~FX_Missile_Explosion()
{
delete m_bubble_expl;
}
void FX_Missile_Explosion::update(void)
{
if (!m_running) return;
if (g_timer->now() - m_start_time > m_duration) {
m_running = false;
return;
}
m_bubble_expl->update();
}
void FX_Missile_Explosion::draw(void)
{
if (!m_running) return;
m_bubble_expl->draw();
}
bool FX_Missile_Explosion::finished(void)
{
return !m_running;
}
bool FX_Missile_Explosion::running(void)
{
return m_running;
}