i am trying to make the Tank actor lose a life when it hits the enemy actor. when it reaches 0 lives it should disappear. Therefore it should take 3 separate hits from the enemy for the tank to die; not 1 !, for some reason the code doesn't work and I think when the enemy touches the actor it takes 3 lives away immediately, is there anyway I can modify the code to make it only take one life at a time? here's the code for the health/life:
private int health = 3;
if (isTouching(enemy.class))
{
health--;
}
if (health == 0)
{
getWorld().removeObject(this);
}

