I'm trying to do a life counter in my game. I already create the counter but i don't know how to remove the pictures from the lifes in the game
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
public class Schlange extends Mover
{
private int Leben=3;
public void act()
{
if ( touches (Punkte.class) )
{ removeTouchedObject(Punkte.class);
collectPoints (1) ;
getWorld().neuePunkte();
}
if ( Greenfoot.isKeyDown("right") )
{
moveRight ();
lookToTheRight ();
}
if ( Greenfoot.isKeyDown("left") )
{
moveLeft ();
lookToTheLeft ();
}
if ( Greenfoot.isKeyDown("up") )
{
moveUp ();
}
if ( Greenfoot.isKeyDown("down") )
{
moveDown ();
}
if( touches(Jaeger.class))
{ Leben = Leben-1;
setLocation(20,300);
}
if(Leben==0)
{
getWorld().gameOver("Game Over", getScore());
}
if(Leben==2)
{
}
if(Leben==1)
{
}
}
}
