So I have my game set up that there is a Controller class that inherits from World, and that is what will handle different classes communicating to each other. The controller class also uses setWorld() to set the current level. Greenfoot will not construct the world because it says it requires a zero-argument constructor, which I don't understand as the Controller constructor already has zero arguments. I am failing to see what I have done differently here to a different game in which I have done in the past which worked in an identical way.
Controller:
Level1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import greenfoot.*; public class Controller extends World { private Level1 level1; public Controller() { super ( 960 , 540 , 1 ); level1 = new Level1( this ); Greenfoot.setWorld(level1); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import greenfoot.*; public class Level1 extends World { private Player thePlayer; private Survivor survivor1; private Fog theFog; private Controller controller; public Level1(Controller c) { super ( 960 , 540 , 1 ); controller = c; |