Hey, I'm new to Greenfoot and need to finish my Game. I would like to add a highscore which is saved and everytime a new highscore is achieved the backround should be switched. that is all it should do and i really need your help. Thanks


1 2 3 4 5 6 7 8 9 10 11 12 13 | import greenfoot.*; //WORLD CLASS public class MyWorld extends World { //DECLARATION AND INITIALIZATION public static int highScore = 0 ; //COUNSTRUCTOR public MyWorld() { } } |
1 2 3 4 5 | if (finalGameScore > highscore) { highscore = finalGameScore; //change image here } |
1 | MyWorld.highScore |