Hello,
I want to make two levels that extending from class level with a method that restarts the level. This class level extends from the class world. But why I get the error constructor Level in class Level cannot be applied to given types. Also it marks super inside of the classes Level 1 and Level 2.
}
public class Level extends World
{
public Level()
{
super(10000, 600, 1);
}
public void LevelNeustarten(){}
}public class Level1 extends Level
{
public Level1()
{
super(10000, 600, 1);
prepare();
addObject(Bild.figur,630,493);
}
private void prepare()
{
Stein stein = new Stein();
addObject(stein, 1231, 482);
}
public void LevelNeustarten()
{
Greenfoot.setWorld(new Level1());
}public class Level2 extends Level
{
public Level2()
{
super(10000, 600, 1);
prepare();
addObject(Bild.figur,630,493);
}
private void prepare()
{
}
public void LevelNeustarten()
{
Greenfoot.setWorld(new Level2());
}
}
