I am trying to make a bomb that explodes, but when it leaves the world it breaks another line of code. anything wrong with this code?
if (isAtEdge())
{
setImage( myGif2.getCurrentImage() );
move(-30);
getWorld().removeObject(this);
}
else if(life <= 5)
{
setImage( myGif2.getCurrentImage() );
move(-30);
}
if(life <= 0)
{
setImage( myGif2.getCurrentImage() );
move(-30);
getWorld().removeObject(this);
}
if (isTouching(Boss.class))
{
setImage( myGif2.getCurrentImage() );
move(-30);
getWorld().removeObject(this);
}
else
{
life--;
}

