From 1c7e2e302e9c148cf3b69363660c2ec35ebfd311 Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Tue, 7 Feb 2023 23:47:12 +0100 Subject: [PATCH] update --- src/main/java/PingPong/Paddle.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/PingPong/Paddle.java b/src/main/java/PingPong/Paddle.java index 25546ae..878807c 100644 --- a/src/main/java/PingPong/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -23,6 +23,7 @@ public class Paddle extends Rectangle { this.id = id; } + public void pressed(KeyEvent e) { } @@ -53,4 +54,13 @@ public class Paddle extends Rectangle { } } + public void draw(Graphics g) { + if (id == 1) { + g.setColor(Color.BLUE); + g.fillRect(x, y1, width, height); + } else { + g.setColor(Color.YELLOW); + g.fillRect(x, y2, width, height); + } + } }