Hello! And sorry for asking so many questions here in such a short period of time.
I'm trying to make a menu which leads to 2 gamemodes of my game, each with their sepparate worlds. After the player wins the game, i want to switch the world back to the menu world which I instantiated previously. How can I acheve this, if it is possible?
I tried doing this:
But this just creates a brand new menu and I don't really want that.
void checkIfVictory()
{
if(this.isAtEdge())
//TODO show victory message
{
//resetting variables
MyWorld.gamemode=-1;
MyWorld.isPlaying=false;
for(int i=0;i<4;i++)
ItemCounter.gems_taken[i]=0;
int score;
//switching to menu
MyWorld w = new MyWorld();
Greenfoot.setWorld(w);
// if (getWorld() instanceof MyWorld)
}
}
