From b726727bdd6e9a6f6f783012f2b23d951012ac1a Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Wed, 8 Feb 2023 00:05:58 +0100 Subject: [PATCH] refactoring: --- src/main/java/PingPong/Ball.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/PingPong/Ball.java b/src/main/java/PingPong/Ball.java index bbc7809..6ccf4d9 100644 --- a/src/main/java/PingPong/Ball.java +++ b/src/main/java/PingPong/Ball.java @@ -44,7 +44,11 @@ Random random; y += yVelocity; } public void draw(Graphics g){ - g.setColor(Color.red); + Color(g); g.fillOval(x, y, width, height); } + + private static void Color(Graphics g) { + g.setColor(Color.red); + } }