I want to add health so I can make it so that if i hit my actor (seal) it would take 3 shots to full kill it.
Im not sure why it wont work, it just adds 100 score every time i hit the seal but it wont die. Do I need to put the code into another class?
public void Shot()
{
Actor bullet = getOneObjectAtOffset(0, 0, Bullet.class);
if (bullet != null)
{
getWorld().removeObject(bullet);
health--;
if (health == 0){
getWorld().removeObject(this);
World myWorld = getWorld();
SealWorld sealworld = (SealWorld)myWorld;
Counter counter = sealworld.getCounter();
counter.addScore(100);
}
}

