How do I set a max score for a level and then change levels when it reaches that number?
//in current World's act method
if (score >= 100) {
//new level
Greenfoot.setWorld(new Level2()); //change worlds
level2(); //or a method which takes care of removing and adding the correct objects
}
private void level2() {
removeObjects(getObjects(Block.class)); //this will remove all the instances of Block
addObject(new Block(), 25, 375); //place new block at specified loaction
}