diff --git a/src/main/java/PingPong/Ball.java b/src/main/java/PingPong/Ball.java index 42d9752..22a7e65 100644 --- a/src/main/java/PingPong/Ball.java +++ b/src/main/java/PingPong/Ball.java @@ -16,13 +16,18 @@ Random random; int randomXDirection = random.nextInt(2); if (randomXDirection == 0) randomXDirection--; - setXDirection(randomXDirection * ballSpeed); + xDirect(randomXDirection); int randomYDirection = random.nextInt(2); if (randomYDirection == 0) randomYDirection--; setYDirection(randomYDirection * ballSpeed); } + + private void xDirect(int randomXDirection) { + setXDirection(randomXDirection * ballSpeed); + } + public void setXDirection (int randomXDirection){ xVelocity = randomXDirection; } diff --git a/target/classes/PingPong/Ball.class b/target/classes/PingPong/Ball.class index 533736e..55cdf37 100644 Binary files a/target/classes/PingPong/Ball.class and b/target/classes/PingPong/Ball.class differ