Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 51 lines (37 sloc) 0.791 kb
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;
}
Something went wrong with that request. Please try again.