diff --git a/src/main/java/PingPong/CollisionChecker.java b/src/main/java/PingPong/CollisionChecker.java index 6543814..c2cf1ca 100644 --- a/src/main/java/PingPong/CollisionChecker.java +++ b/src/main/java/PingPong/CollisionChecker.java @@ -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); + } }