The enemy must move horizontally on one line, and after picking up the object, return to the n-th position and start moving vertically as well from one corner to another at these coordinates? How i can make it?
![Twitter](/assets/twitter-4e19209ef84344ee0c433f4c7bad8d49.png)
![Twitter.hover](/assets/twitter.hover-1fb19a5bafc50deace8f88eaec867845.png)
public void moveAround(){ if (isAtEdge()){ getImage().mirrorHorizontally(); direction = -direction; } setLocation(getX() + 1*direction, getY()); // setLocation(getX(), getY() 1*direction); if you want it move vertically }