diff --git a/src/main/java/PingPong/CollisionChecker.java b/src/main/java/PingPong/CollisionChecker.java index a38b4f8..59c3ed0 100644 --- a/src/main/java/PingPong/CollisionChecker.java +++ b/src/main/java/PingPong/CollisionChecker.java @@ -13,4 +13,8 @@ public class CollisionChecker { public Boolean didTouchLeftEdge(Integer ballXCoordinate) { return ballXCoordinate <= 0; } + public Boolean didTouchRightEdge(Integer ballXCoordinate, Integer maxWidth) { + return ballXCoordinate >= maxWidth; + } + }