I want an actor to be removed after I hit it 5 times.
I shoot with the Actor "Laser" and I want "Flieger" to be removed after getting hit 5x.
Here is my Code of the Flieger class:
Can sb help me pls?
public class Flieger extends Actor
{
public void act()
{
move South();
takeDamage();
}
int b = 0;
public void takeDamage()
{
if(isTouching(Laser.class))
{
b++;
}
if(b > 4)
{
getWorld().removeObject(this);
return;
}
}
}
