From 3666117de2d20cc224af14b4c108d3357ac2c9e5 Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Tue, 7 Feb 2023 22:05:36 +0100 Subject: [PATCH] refactoring: --- src/main/java/PingPong/Ball.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/PingPong/Ball.java b/src/main/java/PingPong/Ball.java index 22a7e65..bbc7809 100644 --- a/src/main/java/PingPong/Ball.java +++ b/src/main/java/PingPong/Ball.java @@ -19,6 +19,10 @@ Random random; xDirect(randomXDirection); int randomYDirection = random.nextInt(2); + yDirect(randomYDirection); + } + + private void yDirect(int randomYDirection) { if (randomYDirection == 0) randomYDirection--; setYDirection(randomYDirection * ballSpeed);