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/MenuPanel.java b/src/main/java/MenuPanel.java index 709c4a7..098f221 100644 --- a/src/main/java/MenuPanel.java +++ b/src/main/java/MenuPanel.java @@ -2,6 +2,8 @@ import PingPong.GamePanel; import javax.swing.*; import java.awt.*; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; import java.awt.event.KeyListener; @@ -29,6 +31,16 @@ public class MenuPanel extends JPanel { } - public class AL implements KeyListener { + public class AL extends KeyAdapter { + + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_1) { + new GameFrame(); + + } +} + } + + private class GameFrame { } } \ No newline at end of file diff --git a/src/main/java/PingPong/GameFrame.java b/src/main/java/PingPong/GameFrame.java index 5cb7cf2..6f87f8e 100644 --- a/src/main/java/PingPong/GameFrame.java +++ b/src/main/java/PingPong/GameFrame.java @@ -18,6 +18,4 @@ public class GameFrame extends JFrame { } - } - } diff --git a/src/main/java/PingPong/GamePanel.java b/src/main/java/PingPong/GamePanel.java index 22a2aee..89ff717 100644 --- a/src/main/java/PingPong/GamePanel.java +++ b/src/main/java/PingPong/GamePanel.java @@ -1,4 +1,18 @@ package PingPong; -public class GamePanel { +import javax.swing.*; +import java.awt.*; + +public class GamePanel extends JPanel implements Runnable { + static final int FRAME_WIDTH = 1000; + static final int FRAME_HEIGHT = (int) (FRAME_WIDTH * 0.5); + static final int BALL_DIAMETER = 26; + static final int PADDLE_WIDTH = 25; + static final int PADDLE_HEIGHT = 100; + public static final Dimension SCREEN = new Dimension(FRAME_WIDTH, FRAME_HEIGHT); + + + public void run() { + + } } diff --git a/target/classes/Ball.class b/target/classes/Ball.class deleted file mode 100644 index ba843c4..0000000 Binary files a/target/classes/Ball.class and /dev/null differ diff --git a/target/classes/GameFrame.class b/target/classes/GameFrame.class deleted file mode 100644 index 10e34ca..0000000 Binary files a/target/classes/GameFrame.class and /dev/null differ diff --git a/target/classes/GamePanel.class b/target/classes/GamePanel.class deleted file mode 100644 index 2d5d58c..0000000 Binary files a/target/classes/GamePanel.class and /dev/null differ diff --git a/target/classes/MenuPanel$AL.class b/target/classes/MenuPanel$AL.class new file mode 100644 index 0000000..bbbd61b Binary files /dev/null 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 new file mode 100644 index 0000000..8ee37da Binary files /dev/null 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 new file mode 100644 index 0000000..5e1906a Binary files /dev/null and b/target/classes/Snake/Apple.class differ