Here is my code...
public void nextLevel(Class x, Class y)
{
if (getOneIntersectingObject(x) != null)
{
Greenfoot.setWorld(new y);
}
}
im trying to create this so that i dont have to individualy set the world to a new one for each of my end of level flags...
the 5th line where it sais Greenfoot.setWorld(new y); does not work i have also tried (new y()) but neither work
![Twitter](/assets/twitter-4e19209ef84344ee0c433f4c7bad8d49.png)
![Twitter.hover](/assets/twitter.hover-1fb19a5bafc50deace8f88eaec867845.png)