diff --git a/src/main/java/PingPong/GamePanel.java b/src/main/java/PingPong/GamePanel.java index 6101b6c..3b982e5 100644 --- a/src/main/java/PingPong/GamePanel.java +++ b/src/main/java/PingPong/GamePanel.java @@ -2,6 +2,8 @@ package PingPong; import javax.swing.*; import java.awt.*; +import java.util.Random; + public class GamePanel extends JPanel implements Runnable { static final int FRAME_WIDTH = 1000; @@ -11,14 +13,30 @@ public class GamePanel extends JPanel implements Runnable { static final int PADDLE_HEIGHT = 100; public static final Dimension SCREEN = new Dimension(FRAME_WIDTH, FRAME_HEIGHT); + Ball ball; + Paddle paddle_1; + Paddle paddle_2; + Score score; public void run() { } + public void draw(Graphics g) { + score.draw(g); + paddle_1.draw(g); + paddle_2.draw(g); + ball.draw(g); + + } + public void newBall() { ball = new Ball((FRAME_WIDTH/2)-(BALL_DIAMETER/2), ((FRAME_HEIGHT/2)-(BALL_DIAMETER/2)), BALL_DIAMETER, BALL_DIAMETER); } + + + + } diff --git a/src/main/java/PingPong/Paddle.java b/src/main/java/PingPong/Paddle.java index c1483f2..dc71933 100644 --- a/src/main/java/PingPong/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -1,4 +1,8 @@ package PingPong; +import java.awt.*; + public class Paddle { + public void draw(Graphics g) { + } } diff --git a/src/main/java/PingPong/Score.java b/src/main/java/PingPong/Score.java index 10a75ce..b364a50 100644 --- a/src/main/java/PingPong/Score.java +++ b/src/main/java/PingPong/Score.java @@ -1,4 +1,8 @@ package PingPong; +import java.awt.*; + public class Score { + public void draw(Graphics g) { + } } diff --git a/target/classes/PingPong/Ball.class b/target/classes/PingPong/Ball.class index 55cdf37..5a6f0b6 100644 Binary files a/target/classes/PingPong/Ball.class and b/target/classes/PingPong/Ball.class differ diff --git a/target/classes/PingPong/GamePanel.class b/target/classes/PingPong/GamePanel.class index 601ef2b..6da66e1 100644 Binary files a/target/classes/PingPong/GamePanel.class and b/target/classes/PingPong/GamePanel.class differ