Hi i'm attempting to put together my first game after following a tutorial from my course. Th piece of code i have makes my enemy go back and forth along the Y axis:
private void autoMove()
{
if (forward == true)
move(3);
else
move(-3);
//ENDIF
if(getX()>=getWorld().getWidth()-1)
forward=false;
if(getX()<=1)
forward=true;
}
I would like him to be moving along the X axis only on the right hand side of the screen and if possible have the movement randomly going up and down so as not to be too predictable. Please Help!!!

