From 72ce816ac2918061926ff6b77e31dae7c0bcbadf Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Tue, 7 Feb 2023 22:45:41 +0100 Subject: [PATCH] update --- src/main/java/PingPong/GamePanel.java | 18 ++++++++++++++++++ src/main/java/PingPong/Paddle.java | 4 ++++ src/main/java/PingPong/Score.java | 4 ++++ target/classes/PingPong/Ball.class | Bin 1504 -> 1604 bytes target/classes/PingPong/GamePanel.class | Bin 720 -> 1251 bytes 5 files changed, 26 insertions(+) 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 55cdf373e74fa3a532ddcf289cc8a74d0d81e69c..5a6f0b6f166c841d3996d901f6cfe6351b6990f0 100644 GIT binary patch literal 1604 zcmZ`(>vG#<5Ivt`OR=LkiBqREb||HnIC5JjT*}3zg`~7KIBlA=rWyXA*uoYlQbtv7 z|9J}D0;X|iV1@_aHFyugS;>)u2Q;Java9dxp0oSu&%b~B1HfnaCWjQpbfgVrpeYo7 zunw%6br{w*?RIE+UDsC7?mC_m-c!&k4L(b)EXI-5kuxv>Lt%2m@wywn*R8EuuB(vU z;k319+Z_ef(2-Y|j&S!w$E|HzUdP|fVG`34bVgyU5<|`!xPT(#1<@zWra5}7F6S;9 zcng=9j%Oc*4KGwkR~k!=9J4AJC}V-HqX$kv2C=IpuFD4AiCo9AOKk5NxGJ{ES9Z7^ zn;qX1&vgSg&O9#@j}WgISQ6IRqn7RZZ6`byYt_Kb$a;Lp<76@b znXQbTk7fScz!#E6=FsVcJxOfMzyq;pJ=^K_LJ9NGz$0mh@$VhieR^QIRC3Mlup6eD zj%PpF-`%l;=hlw&N1^GrEw^O_j_e1i+0mUA9cxP)o;=L{++po&?nFpoOs zSiXz+ieEmCGr-qqa>rbx+nArM*l7{3RVg;{#l|9&=T%(BI#(HD>3G7GhNtw;K%Fv- zrej>mLsLqw%z*H>1QDSMB_X3u%@T>|y*{oC2^1n3=Q)-LT_)s0l;~W1GD)-$g;i15 zF({pGUfV&SwLzeXB*Ha`kcuRd{}q^3j)fBmV&sVgc_O05Mv&_}0KCUDa!NBxCs-WC zx<(7M1_>)X!{z|`B@+?K-k`Z@zXhgwqCN7*UYOY8uHhGHx&dqmbQt-h8#W(GIu8J84jfz1s)9RfC#% z)t2O(F*qCVc;Y;!99%HCh)W952NmR|amB%m!BsS(JvCFAHJFp^%)9oBuqEf`4Q_}> zx0>yjtT`VFWL^*m1xOs6!Urq`n}!{@;cas z)9T^W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