Yep that's the code I put in to get it to work haha.
Now how can you create a screen for when the hearts go zero, to go blue and say game over. I know that in the touchLizard method you put an if(counter2==0)
{
}
It's just I don't know how to get the screens to change, can you also help me with this problem please?
You could remove all the actors from the current world or set a different world active (to get to the same point of having an active world with no actors in it. If you have actors being added by way of your World subclass act method, setting a new World object active would be the way to go. At this point, you can work with the background image of the now current world as needed. The methods you might use are
(1) if changing worlds, the Greenfoot class method 'setWorld';
(2) if removing actors, the World object methods 'getObjects' and 'removeObjects'
(3) if setting a new background image for the world, one of the World object 'setBackground' methods;
(4) if altering the background image, any one of a number of GreenfootImage object methods.
Refer to the API documentation of any class you may have questions concerning.