Needing help with the subject above i have tried this code:
public void youWin()
{
if (score==5)
{
getWorld().addObject(new YouWin(), 400,300);
Greenfoot.stop();
}
}
Had no errors while testing and couldnt get it to work. If you're needing any other code to see what the problem could be just ask thanks.