Hey, I've been trying for quite a while now to make this work but it just doesn't want to!
I tried accessing a class from the world class and create a condition where the game only starts working once I click on that specific class.
When I do that though an error appears which doesnt let me start the game anymore!
The code looks like this:
And that's the error:
Regards
if (Greenfoot.mouseClicked(getObjects(Preparation.class).get(0)))
{
spawntime1--;
spawntime2--;
spawntime3--;
spawntime4--;
spawntime5--;
}java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at PlantsVsZombies.act(PlantsVsZombies.java:35) at greenfoot.core.Simulation.actWorld(Simulation.java:573) at greenfoot.core.Simulation.runOneLoop(Simulation.java:506) at greenfoot.core.Simulation.runContent(Simulation.java:193) at greenfoot.core.Simulation.run(Simulation.java:183)
