package MissileCommand;




public class TurretExplosion extends GP.Animator implements MCConstants {


  private int _size;
  private GP.Graphic _radius, _gun;
  private Turret _turret;


  public TurretExplosion(GP.Container frame, Turret turret, GP.Graphic gun) {

    super(frame);

    _turret=turret;
    _gun=gun;
    _size=80;

    // we'll make our blast radius a circle, and grow it through use of an animator
    _radius=new GP.Graphics.FilledOval(frame);
    _radius.SetColor(new GP.Attributes.Colors.White());
    _radius.SetSize(new GP.Attributes.Size(_size,_size));

    GP.Attributes.Position pos=_turret.GetPosition();
    _radius.SetPosition(new GP.Attributes.Position(pos.GetX(),pos.GetY()));


  }



  public void Action() {
    
    _size +=10;

    _radius.SetSize(new GP.Attributes.Size(_size,_size));
  
    if (_size > BLAST_RADIUS+60) {
      _radius.Hide();
      _gun.Hide();
      _turret.Wreck();
      this.Stop();
     
    }
    
  }




}

