@ -1,7 +1,12 @@
package PingPong;
import java.awt.*;
public class CollisionChecker {
public Boolean didTouchTopOrBottomEdge(Integer ballYCoordinate, Integer maxHeight) {
return ballYCoordinate <= 0 || ballYCoordinate >= maxHeight;
}
public Boolean didTouchPaddle(Rectangle ball, Rectangle paddle) {
return ball.intersects(paddle);