#include "shockwaveactor.h"

void ShockwaveActor::activate()
{
  r = RINC;
  t = 0;
  state = SW_EXPAND;
}

void ShockwaveActor::update()
{
  switch(state) {
    case SW_EXPAND:
      r += RINC;
      if(r >= RMAX) {
        r = RMAX;
        state = SW_SHRINK;
      }
      break;
    case SW_SHRINK:
      r -= RINC;
      if(r <= 0) {
        r = 0;
        state = SW_FINISHED;
      }
      break;
    default:
      break;
  }

  if(state != SW_NULL)
    t++;
}
