From d1886f08a1764c5b4bd02f0cb1ad2b664eaf73ef Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Tue, 7 Feb 2023 23:35:40 +0100 Subject: [PATCH] update --- src/main/java/PingPong/Paddle.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/PingPong/Paddle.java b/src/main/java/PingPong/Paddle.java index eb15f54..3131276 100644 --- a/src/main/java/PingPong/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -3,10 +3,23 @@ package PingPong; import java.awt.*; import java.awt.event.KeyEvent; -public class Paddle { - public void draw(Graphics g) { - } +public class Paddle extends Rectangle{ + int y1; + int y2; + int id; + Paddle(int x, int y, int width, int height, int id) { + //super(x, y, width, height); + this.x = x; + if (id == 1) { + y1 = y; + } else if (id == 2) { + y2 = y; + } + this.width = width; + this.height = height; + this.id = id; + } public void pressed(KeyEvent e) { }