I'm trying to get one of my actors to switch between a couple of images but I can't seem to get it right. Here is what I have so far.
Any help is much appreciated :)
private GreenfootImage image1; private GreenfootImage image2; public void act() { image1 = new GreenfootImage ("turtle2.png"); image2 = new GreenfootImage ("turtle1.png"); setImage (image1); if (getImage() == image1) { setImage (image2); } else { setImage (image1); } }