From f0109dfba08d1e085bdc47f9547b05cbd25c15d4 Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Tue, 7 Feb 2023 23:42:06 +0100 Subject: [PATCH] refactoring: --- src/main/java/PingPong/Paddle.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/PingPong/Paddle.java b/src/main/java/PingPong/Paddle.java index abe5d60..25546ae 100644 --- a/src/main/java/PingPong/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -32,9 +32,17 @@ public class Paddle extends Rectangle { public void move() { - y1 += yVelocity1; - y2 += yVelocity2; - } + yVol1(); + yVol2(); + } + + private void yVol2() { + y2 += yVelocity2; + } + + private void yVol1() { + y1 += yVelocity1; + } public void setYDirection(int yDirection, int paddleId) {