need help with lives counter, trying to make it that when i hit a meteorite 1 live is taken away, until i have 0, the greenfoot stops. but for some reason it is not working.
public void checkCollision()
{
World world=getWorld();
world.showText("Lives" + lives, 625,30);
{
if(isTouching(Meteorite.class))
{
world.removeObject(this);
lives--;
if(lives <= 0)
{
Greenfoot.stop();
//handleGameOver();
}
world.addObject(newPlayer1(),400,800);
}
}
}
