i'm trying to put a lives of my character in the game i created.
and this is my code.
private void live()
{
lives = 3;
lives--;
getWorld().showText("Lives:" + lives, 32, 50);
}
public void lives()
{
if(see(Mad.class))
{
setLocation(50, 455);
live();
if (lives <= 0)
{
Greenfoot.stop();
}
}
}

