I have a animation which goes to the left, but it also has to go to the right. Can I use the mirrorHorizontally in GreenfootImage to flip the images and still keep the animation and if yes, who should I do it?


private static GreenfootImage[] frame = new GreenfootImage[number of frames you have multiplied by two and add one] public myActor() { frame[0] = new GreenfootImage("firstFrame"); frame[1] = new GreenfootImage("secondFrame"); frame[2] = new GreenfootImage("firstFrame"); frame[3] = new GreenfootImage("secondFrame"); for(int i = 2; i < 3; i++) { frame[i].mirrorHorizontally(); } }
/** [number of frames you have multiplied by two and add one]*/ private static GreenfootImage[] frame = new GreenfootImage public Leatherface() { frame[0] = new GreenfootImage("leatherface0"); frame[1] = new GreenfootImage("leatherface1"); for(int i = 0; i < 1; i++) { frame[i].mirrorHorizontally(); } }