public class Main extends World
{
/**
* Constructor for objects of class Main.
*
*/
public Main()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super (600, 400, 1);
}
//This method is called to check if a new highscore was reached.
public void checkNewHighscore()
{
int highScore =10000;
int myScore =100001;
if ( myScore > highScore)
{
System.out.println("Congratulations, you reached a new highscore!");
System.out.printf("The old highscore was %d. \n", highScore);
highScore = myScore;
System.out.println("The new highscore is "+Integer.toString(highScore));
}
else
{
System.out.println("Sorry, no new highscore!");
}
}
}