i get the error
`. java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at you.act(you.java:43)
at greenfoot.core.Simulation.actActor(Simulation.java:567)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:530)
at greenfoot.core.Simulation.runContent(Simulation.java:193)
at greenfoot.core.Simulation.run(Simulation.java:183)
when i try to run
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.List; import java.util.ArrayList; /** * Write a description of class you here. * * @author (your name) * @version (a version number or a date) */ public class you extends ProjectFEAR { int speed = 3; List sus; /** * Act - do whatever the you wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { if(Greenfoot. isKeyDown("A")) { setLocation(getX()-speed, getY()); } if(Greenfoot. isKeyDown("D")) { setLocation(getX()+speed, getY()); } if(Greenfoot. isKeyDown("W")) { setLocation(getX(), getY()-speed); } if(Greenfoot. isKeyDown("S")) { setLocation(getX(), getY()+speed); } if(isTouching(enemys.class)) { sus = getObjectsInRange(20, enemys.class); sus.add(sus.get(0)); } } }