Thank you very much! I have learned a lot from this. I still have one other problem though.
while ( !getWorld(getObjects(Actor.Flower).isEmpty()) )
This gets the error "cannot find symbol - variable Actor"
Am I using the wrong keyword for this?
Try 'Flower.class' instead of 'Actor.Flower'. Also, you are missing a couple of characters after 'getWorld(' -- it should be 'getWorld().getObjects('...
Everything works now, but when I manually place the actor I get a terminal error.
"java.lang.NullPointerException
at MazeRunner.<init>(MazeRunner.java:21)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at greenfoot.core.Simulation.newInstance(Simulation.java:635)
at greenfoot.localdebugger.LocalDebugger$QueuedInstantiation.run(LocalDebugger.java:155)
at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:468)
at greenfoot.core.Simulation.maybePause(Simulation.java:282)
at greenfoot.core.Simulation.runContent(Simulation.java:213)
at greenfoot.core.Simulation.run(Simulation.java:206):
You probably did not remove the code I originally gave you from your code (as posted previously on page 1 of this discussion, lines 31 through 33 of the MazeRunner class).
Actually, those lines need to be placed before your statements that use 'worldWidth' and 'worldHeight'.
I doubt it. I believe that 'getWorld' will return 'null' there. Again, I am not familiar with sofia, but I believe that the 'super' Actor call must be called before it will return a World object. It may not even then, until the constructor has completed its execution.