Hello, I am having some issues with the getWorld().removeObject(); comment.
I would like to remove my WinScreen for the first Level so that I can start a new Level whenever the next Level button is pressed.
That is my code in the nextLVL.class:
public void nextLVL(){
if(Greenfoot.mouseClicked(this)){
getWorld().removeObject(this);
getWorld().removeObject(WinScreenLVL1.class);
}
}public void nextLVL(){
if(Greenfoot.mouseClicked(this)){
getWorld().removeObject(WinScreenLVL1.class);
getWorld().removeObject();
}
}getWorld().removeObjects(getWorld().getObjects(WinScreenLVL1.class));