From 6f10b5d2e6f86347e30e9a7e3a4ad97bf3eb19b8 Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Mon, 6 Feb 2023 14:32:20 +0100 Subject: [PATCH] update --- .../java/build-project.sh => build-project.sh | 0 src/main/java/MenuPanel.java | 24 ++++++++++++++++++- src/main/java/{ => PingPong}/Ball.java | 2 ++ src/main/java/{ => PingPong}/GameFrame.java | 4 ++++ src/main/java/{ => PingPong}/GamePanel.java | 2 ++ src/main/java/{ => PingPong}/Paddle.java | 2 ++ src/main/java/{ => PingPong}/Score.java | 2 ++ 7 files changed, 35 insertions(+), 1 deletion(-) rename src/main/java/build-project.sh => build-project.sh (100%) rename src/main/java/{ => PingPong}/Ball.java (53%) rename src/main/java/{ => PingPong}/GameFrame.java (94%) rename src/main/java/{ => PingPong}/GamePanel.java (58%) rename src/main/java/{ => PingPong}/Paddle.java (55%) rename src/main/java/{ => PingPong}/Score.java (54%) diff --git a/src/main/java/build-project.sh b/build-project.sh similarity index 100% rename from src/main/java/build-project.sh rename to build-project.sh diff --git a/src/main/java/MenuPanel.java b/src/main/java/MenuPanel.java index 15aed4d..709c4a7 100644 --- a/src/main/java/MenuPanel.java +++ b/src/main/java/MenuPanel.java @@ -1,5 +1,8 @@ +import PingPong.GamePanel; + import javax.swing.*; import java.awt.*; +import java.awt.event.KeyListener; public class MenuPanel extends JPanel { @@ -9,4 +12,23 @@ public class MenuPanel extends JPanel { this.setBackground(Color.BLACK); this.setFocusable(true); this.setPreferredSize(GamePanel.SCREEN); -} + } + + protected void paintComponent(Graphics g) { + super.paintComponent(g); + draw(g); + } + public void draw(Graphics g) { + g.setColor(Color.WHITE); + g.setFont(new Font("Consolas", Font.BOLD, 70)); + g.drawString("GAME MENU", 330, 100); + g.setFont(new Font("Consolas", Font.BOLD, 30)); + g.drawString("Press 'ENTER' to start the game", 265, 200); + g.setFont(new Font("Consolas", Font.PLAIN, 10)); + g.drawString("Created by Hells Gamers", 450, 450); + + } + + public class AL implements KeyListener { + } +} \ No newline at end of file diff --git a/src/main/java/Ball.java b/src/main/java/PingPong/Ball.java similarity index 53% rename from src/main/java/Ball.java rename to src/main/java/PingPong/Ball.java index f1f843c..9fe0189 100644 --- a/src/main/java/Ball.java +++ b/src/main/java/PingPong/Ball.java @@ -1,2 +1,4 @@ +package PingPong; + public class Ball { } diff --git a/src/main/java/GameFrame.java b/src/main/java/PingPong/GameFrame.java similarity index 94% rename from src/main/java/GameFrame.java rename to src/main/java/PingPong/GameFrame.java index b6813fb..5cb7cf2 100644 --- a/src/main/java/GameFrame.java +++ b/src/main/java/PingPong/GameFrame.java @@ -1,3 +1,5 @@ +package PingPong; + import javax.swing.*; import java.awt.*; @@ -16,4 +18,6 @@ public class GameFrame extends JFrame { } + } + } diff --git a/src/main/java/GamePanel.java b/src/main/java/PingPong/GamePanel.java similarity index 58% rename from src/main/java/GamePanel.java rename to src/main/java/PingPong/GamePanel.java index 3311fd3..22a2aee 100644 --- a/src/main/java/GamePanel.java +++ b/src/main/java/PingPong/GamePanel.java @@ -1,2 +1,4 @@ +package PingPong; + public class GamePanel { } diff --git a/src/main/java/Paddle.java b/src/main/java/PingPong/Paddle.java similarity index 55% rename from src/main/java/Paddle.java rename to src/main/java/PingPong/Paddle.java index 942d2bd..c1483f2 100644 --- a/src/main/java/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -1,2 +1,4 @@ +package PingPong; + public class Paddle { } diff --git a/src/main/java/Score.java b/src/main/java/PingPong/Score.java similarity index 54% rename from src/main/java/Score.java rename to src/main/java/PingPong/Score.java index e188430..10a75ce 100644 --- a/src/main/java/Score.java +++ b/src/main/java/PingPong/Score.java @@ -1,2 +1,4 @@ +package PingPong; + public class Score { }