From ccf2517fbfa153dac3fa54ffac2725f18ba74958 Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Tue, 7 Feb 2023 23:52:15 +0100 Subject: [PATCH] refactoring: --- src/main/java/PingPong/Paddle.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/PingPong/Paddle.java b/src/main/java/PingPong/Paddle.java index 5d14044..eb5f8d0 100644 --- a/src/main/java/PingPong/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -56,7 +56,7 @@ public class Paddle extends Rectangle { public void draw(Graphics g) { if (id == 1) { - g.setColor(Color.BLUE); + Paddle2(g); g.fillRect(x, y1, width, height); } else { Paddle1(g); @@ -64,6 +64,10 @@ public class Paddle extends Rectangle { } } + private static void Paddle2(Graphics g) { + g.setColor(Color.BLUE); + } + private static void Paddle1(Graphics g) { g.setColor(Color.YELLOW); }