//this is inside my player class, I am trying to remove a player when he touches a bomb and then decrease life count and then add another player
}
public void die ()
{
int lifeCount = 3;
BouncingBomb b = (BouncingBomb) getOneIntersectingObject(BouncingBomb.class);
if (b != null)
{
World w = getWorld();
MyWorld mw = (MyWorld) getWorld();
Player play = mw.getPlayer();
getWorld().removeObject(play);
lifeCount-- ;
if (lifeCount == 2)
{
getWorld().addObject(new Player(), 20, 545);
}
if (lifeCount == 0)
{
dead = true;
}
}
}
