i've created a game where actors (Alien) move from the right side of the screen to the left. i've tried to give them different set speeds as they move across with this code:
public void Speed()
{
int myRadNum = 0;
myRadNum = Greenfoot.getRandomNumber(100);
if (myRadNum < 25)
{
setLocation(getX()-1,getY());
}
else
if (myRadNum < 50)
{
setLocation(getX()-2,getY());
}
else
if (myRadNum < 75)
{
setLocation(getX()-10,getY());
}
else
setLocation(getX()-20,getY());
}
but instead of moving at a set speed they change speed as they move. is there a way to give them a set speed without having multiple Alien subclasses?

