So me and my friend are making a game together and we want it so that when our character reaches a certain spot on the map, the world changes into a new level/room. we have no code written rn. How would we do that?
If you're checking a certain spot you can use it's X and Y Coordinates you can use this in your Character class:
If(getX() == xlocation && getY() == ylocation){
Greenfoot.setWorld(new WorldNameHere());
}
Where xlocation and ylocation are the coordinates of the spot you want to change the world.
Alternatively, you can use an object that will change the world on collision.
In your character class you add this line of code:
If(isTouching(ObjectCLassName.class)){
Greenfoot.setWorld(new WorldNameHere());
}