public class score extends Actor
{
/**
* Act - do whatever the score wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
int score = 0;
public void act()
{
setImage(new GreenfootImage("Score : " + score, 24, Color.GREEN, Color.BLACK));
}
public void addScore()
{
score++;
}
}