private void swoop(){ canMoveLaterally = false; if (swoopingDown) { setLocation(getX(), getY() + 2 ); speed += 10; if (getY() >= maxY) { swoopingDown = false; // Change direction to move up } } // move back up and then only do move method until timer else { if (getY() > minY) { setLocation(getX(), getY() ); speed += 3; } else { swoopingDown = true; // Reset to swoop down again canMoveLaterally = true; speed = 5; } } }