Im new to greenfoot and have to create a game with levels. I have tried a counter but it does not seem to work. Is there another way to do it?
int current_level = 0
public void setLevel(int level)
{
current_level = level;
clean_world();
switch(level)
{
case 0: level_one();
case 1: level_two();
}
}
public void nextLevel()
{
current_level++;
setLevel(current_level);
}
public void clean_world()
{
removeObjects(getObjects(player.class));
}
public void level_one()
{
System.out.println("level one");
}