Hello everybody,
Im almost done creating my scenario only im struggling with the last part of it, the winner image.
I want a image to pop up after one of the two players reached 5 points first.
I already started writing this code a little bit but i cant complete it myself.
This is what i have so far:
public void endGame)
{
Counter counter1 = (Counter) getWorld().getObjects(Counter1.class).get(0);
Counter counter2 = (Counter) getWorld().getObjects(Counter2.class).get(0);
if (counter1.getValue() >= 5) {
Greenfoot.stop();
// code when player 1 reached 5 first
}
if (counter2.getValue() >= 5) {
Greenfoot.stop();
// code when player 2 reached 5 first
}
--------------------------------------------------------------------------------------------------------
As u can see i already did a part of it. This is the way i want it to be, so i only need a code for an image to pop up when one of the players reached 5. I want greenfoot to load the image and not make another class with the name winner image.
Can somebody help me with this last code?
thank you

