addObject(new Actor() { { setImage(new GreenfootImage("Final Score\n"+finalScore, 64, null, null)); } }, getWidth()/2, getHeight()/2);
addObject(new Actor() { { setImage(new GreenfootImage("Final Score\n"+finalScore, 64, null, null)); } }, getWidth()/2, getHeight()/2);
public GameOver(int finalScore, int time)
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,20, Color.BLUE, Color.WHITE)); } public void addScore() { score++; }
Counter counter = new Counter(); /** * Constructor for objects of class Level1. * */ public Level1() { super(600, 400, 1); prepare(); //Names and Locations of all the Actors in Level1 } public Counter getCounter() { return counter; }
addObject(new Actor() { { setImage(new GreenfootImage("Final Score: "+finalScore\n\nTime: "+time, 64, null, null)); } }, getWidth()/2, getHeight()/2);