Hey, I'm trying to create a movement pattern for a boss where it goes up and down. I've been able to move it down but it doesn't want to change its direction once it's reached its point.
here's the code that I've been testing out, I saw this on a previous post here and I tried copying it but it doesn't work for me, I'm hoping someone can tell me what the problem is becasue I have no clue.
public void movement2() { int move = 5; if (getX() == 465) { setLocation(getX() , getY() - move); if (move > 0 && getY() >= 500) { setLocation(getX(), 500); move =-move; } if (move < 0 && getY() <= 200) { setLocation(getX(), 200); } }