So I have to remove the current actor when the gif animation ends. This is what I have at this moment.
Any suggestions on how I can do this?
import greenfoot.*;
public class Explosion extends Starter
{
private int minExplosionTime = 5;
private int ExplosionTime = 0;
private GifImage Img = new GifImage("Explosion.gif");
public void act()
{
setImage(Img.getCurrentImage());
ExplosionTime++;
if (ExplosionTime >= minExplosionTime)
{
ExplosionTime = 0;
getWorld().removeObject(this);
}
}
}

