So initially I want it to go down, and when it hits Y = 53 it changes its direction and goes up. But it just keeps going down but I can't see where the problem is.
Thanks ;))))
public void act()
{
movement(checkDirection());
}
public int checkDirection(){
int speed=0;
if (getY()>330){
speed= -5;
}
if (getY()<53){
speed= 5;
}
return speed;
}
public void movement(int a){
setLocation(getX(),getY()+a);
}


