I'm having trouble with my animating, right now i have an Enemy that moves towards the left, and when it hits a wall, it moves down a little and begins to move towards the right, like Space Invaders. My problem is that my alien only faces towards the right, even when its moving left, can you show me how to make it face the direction that its moving? I already have 2 images, one where it faces towards the left and right.
Here's what i got so far.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Alien here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Alien extends Bad_Guys
{
public int SpeedX = 5;
public void act()
{
move(SpeedX);
checkWalls();
if (Greenfoot.getRandomNumber(1000) > 990) {
getWorld().addObject(new Bullets(), getX(), getY());
}
}
public void checkWalls()
{
if (atWorldEdge())
{
SpeedX = SpeedX*-1;
setLocation(getX(), getY() + 20);
}
}
}

