i have found a problem...
this code is a timer, which i need it to stop when my actor dies. i've tried greenfoot.stop but it takes away the purpose of restarting. i need a code that will stop the timer but not the game when my actor dies
int score = 0;
/**
* Act - do whatever the Counter wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
setImage(new GreenfootImage("Score : " + score,60, Color.GREEN, Color.YELLOW));
addScore();
}
public void addScore()
{
score++;
}