Hey guys, I know how to do this on Action Script 3?
But not Java
//If (the ball goes in this square area 50 pixels wide and 100 pixels long)
//{then move the ball back 100 on it's x axis}
I hope this is enough information.
if (ball.getX() + ball.getImage().getWidth() / 2 > areaLeft && ball.getX() - ball.getImage().getWidth() / 2 < areaRight && ball.getY() + ball.getImage().getHeight() / 2 > areaTop && ball.getY() - ball.getImage().getHeight() / 2 < areaBottom)
ball.setLocation(ball.getX() - 100, ball.getY());if (getX() + getImage().getWidth() / 2 > areaLeft && getX() - getImage().getWidth() / 2 < areaRight && getY() + getImage().getHeight() / 2 > areaTop && getY() - getImage().getHeight() / 2 < areaBottom)
setLocation(getX() - 100, getY());