diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 999a029..098f221 100644 --- a/src/main/java/MenuPanel.java +++ b/src/main/java/MenuPanel.java @@ -1,9 +1,14 @@ +import PingPong.GamePanel; + import javax.swing.*; import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; + public class MenuPanel extends JPanel { + MenuPanel() { this.addKeyListener(new MenuPanel.AL()); this.setBackground(Color.BLACK); @@ -11,27 +16,31 @@ public class MenuPanel extends JPanel { 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); + 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 extends KeyAdapter { public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_ENTER) { - GameFrame gameFrame = new GameFrame(); + if (e.getKeyCode() == KeyEvent.VK_1) { + new GameFrame(); + } +} + } - } + private class GameFrame { } } \ 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 96% rename from src/main/java/GameFrame.java rename to src/main/java/PingPong/GameFrame.java index b6813fb..6f87f8e 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.*; diff --git a/src/main/java/GamePanel.java b/src/main/java/PingPong/GamePanel.java similarity index 70% rename from src/main/java/GamePanel.java rename to src/main/java/PingPong/GamePanel.java index 7e982fb..89ff717 100644 --- a/src/main/java/GamePanel.java +++ b/src/main/java/PingPong/GamePanel.java @@ -1,3 +1,5 @@ +package PingPong; + import javax.swing.*; import java.awt.*; @@ -7,5 +9,10 @@ public class GamePanel extends JPanel implements Runnable { static final int BALL_DIAMETER = 26; static final int PADDLE_WIDTH = 25; static final int PADDLE_HEIGHT = 100; - static final Dimension SCREEN = new Dimension(FRAME_WIDTH, FRAME_HEIGHT); + public static final Dimension SCREEN = new Dimension(FRAME_WIDTH, FRAME_HEIGHT); + + + public void run() { + + } } 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 { } diff --git a/target/classes/MenuPanel$AL.class b/target/classes/MenuPanel$AL.class index f407127..bbbd61b 100644 Binary files a/target/classes/MenuPanel$AL.class and b/target/classes/MenuPanel$AL.class differ diff --git a/target/classes/MenuPanel$GameFrame.class b/target/classes/MenuPanel$GameFrame.class new file mode 100644 index 0000000..3799f31 Binary files /dev/null and b/target/classes/MenuPanel$GameFrame.class differ diff --git a/target/classes/MenuPanel.class b/target/classes/MenuPanel.class index 94ce984..8ee37da 100644 Binary files a/target/classes/MenuPanel.class and b/target/classes/MenuPanel.class differ diff --git a/target/classes/PingPong/GameFrame.class b/target/classes/PingPong/GameFrame.class new file mode 100644 index 0000000..bf5657e Binary files /dev/null and b/target/classes/PingPong/GameFrame.class differ diff --git a/target/classes/Snake/Apple.class b/target/classes/Snake/Apple.class index 83048c4..5e1906a 100644 Binary files a/target/classes/Snake/Apple.class and b/target/classes/Snake/Apple.class differ