I get a NullPointerException in this peace of code:
public void completeLevel4()
{
if (this.score==7){
try
{
World world = (Level4) getWorld();
//further actions
world.removeObjects(world.getObjects(Announcement.class));
world.addObject(new Announcement("You won"),400,400);
Greenfoot.delay(200);
Greenfoot.setWorld(new Begin());
}catch (ClassCastException x) {}
}
}
I do not know why I get this error.

