From c9c6148b99802f1edad798527b3ba96b18ab8a52 Mon Sep 17 00:00:00 2001 From: Berkan Sarp Date: Tue, 31 Jan 2023 23:22:20 +0100 Subject: [PATCH] Update and add GamePanel --- src/main/java/GamePanel.java | 2 ++ src/main/java/MenuPanel.java | 17 +++++++++++++++-- target/classes/Main.class | Bin 237 -> 0 bytes target/classes/java/build-project.sh | 1 + target/classes/main/java/build-project.sh | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/main/java/GamePanel.java delete mode 100644 target/classes/Main.class create mode 100644 target/classes/java/build-project.sh create mode 100644 target/classes/main/java/build-project.sh diff --git a/src/main/java/GamePanel.java b/src/main/java/GamePanel.java new file mode 100644 index 0000000..3311fd3 --- /dev/null +++ b/src/main/java/GamePanel.java @@ -0,0 +1,2 @@ +public class GamePanel { +} diff --git a/src/main/java/MenuPanel.java b/src/main/java/MenuPanel.java index 0fa2ec8..d505047 100644 --- a/src/main/java/MenuPanel.java +++ b/src/main/java/MenuPanel.java @@ -1,2 +1,15 @@ -public class MenuPanel { -} +import javax.swing.*; +import java.awt.*; + +public class MenuPanel extends JPanel { + MenuPanel() { + this.addKeyListener(new MenuPanel.AL()); + this.setBackground(Color.BLACK); + this.setFocusable(true); + this.setPreferredSize(GamePanel.SCREEN); + } + + protected void paintComponent(Graphics g) { + super.paintComponent(g); + draw(g); + } \ No newline at end of file diff --git a/target/classes/Main.class b/target/classes/Main.class deleted file mode 100644 index bc70d746889bbe4f84b0f95b48728d844a6f6def..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 237 zcmXYrO%8%E5QSg)5kVB<4cw^wM5WEhtjFA`o!?f=lKFY-pO#d>(o;2p}Q%EU(M30K3J{u?7Ww30rI kf|eq6$wjRP?CBHiLBN1Vs@wW%kJN8#n{vNp15yLQ4|)wMRsaA1 diff --git a/target/classes/java/build-project.sh b/target/classes/java/build-project.sh new file mode 100644 index 0000000..9a9a4a3 --- /dev/null +++ b/target/classes/java/build-project.sh @@ -0,0 +1 @@ +#!/usr/bin/bash \ No newline at end of file diff --git a/target/classes/main/java/build-project.sh b/target/classes/main/java/build-project.sh new file mode 100644 index 0000000..9a9a4a3 --- /dev/null +++ b/target/classes/main/java/build-project.sh @@ -0,0 +1 @@ +#!/usr/bin/bash \ No newline at end of file