Hello again. I am making progress in my 1v1 player ship game, but now i've run into another problem
I already found a way to make ships explode on contact with the bullets, but the ships are supposed to take three hits before exploding.
i've tested this, but the result is that the ship just takes an infinite amount of hits. the second if statement doesn't seem to execute
public void die()
{ int t=0; //this serves as a hit counter. if you are hit three times, your ship is suppose to explode
if (canSee (P2Bullet.class))
{
eat (P2Bullet.class);
t++;//adds a hit to your counter
}
else if (canSee (P2Bullet.class) && t==3)
{
getWorld().addObject (new Explosion(), getX(), getY());//replaces the ship actor with an explosion actor
getWorld().removeObject(this);//removes your ship from the game
}
}

