OK, first thing: you need your Mouse class to extend Collectable and your Collectable to extend Actor.
Then, you need to move the last line in all your prepare methods in all your worlds to an act method
public void act()
{
if (getObjects(Collectable.class).isEmpty()) setWorld(new NameOfWorld());
}
In your 'GameLevelOne' world: remove all the 'removeObject', 'new Collectable()', and 'addObject(collectable type)' statements. You should only have Mouse and Snake creations and adds here.
For your 'GameLevelTwo' world: Grass should extend Collectable. Etc. for the other levels.
Also, I was getting compile errors when I first opened the scenario. I added blank constructors to the Mouse, Sheep, and the Pig1 classes. Example (using Mouse)
'setWorld' needs to be prefixed with 'Greenfoot'
Greenfoot.setWorld(new NameOfWorld());
Hi, I just copy paste your source code and change NameOfWorld() into world that i have created. but still the error saying that cannot find symbol - method setWorld(); appear. Is something wrong with the compiler or other problem?