I'm trying to make it so that when my counter reaches a certain score in my game it changes to the other world I have while retaining the same score from before and continuing the game. How would I go about doing this?


private World gotoWorld; public OtherWorld(World lastWorld) { gotoWorld = lastWorld; // etc. } public void act() { // whatever if (some condition) Greenfoot.setWorld(gotoWorld); }
if (score >= value) Greenfoot.setWorld(OtherWorld(getWorld());