From bc61cef69b0687728c55aba33ba3f084ea94ea9b Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Thu, 9 Feb 2023 20:20:39 +0100 Subject: [PATCH] refactoring: --- src/main/java/PingPong/Paddle.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/PingPong/Paddle.java b/src/main/java/PingPong/Paddle.java index 34cad3f..2338524 100644 --- a/src/main/java/PingPong/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -22,11 +22,19 @@ public class Paddle extends Rectangle { } else if (id == 2) { y2 = y; } - this.width = width; - this.height = height; + PaddleWidth(width); + PaddleHeight(height); this.id = id; } + private void PaddleHeight(int height) { + this.height = height; + } + + private void PaddleWidth(int width) { + this.width = width; + } + public void released(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_W) {