From 25df7541a73663083781a6f65c44204b63eb85f1 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:25:47 +0100 Subject: [PATCH 01/54] [SnakeGame Class]: definieren der main --- .../JavaGamelauncher/SnakeGame.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java new file mode 100644 index 0000000..08cffc0 --- /dev/null +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -0,0 +1,53 @@ +package de.hs_fulda.gruppenprojekt.JavaGamelauncher; + +import java.awt.AWTException; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.image.BufferedImage; +import java.awt.Image; +import java.awt.Taskbar; +import java.awt.Toolkit; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.lang.System.Logger.Level; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.imageio.ImageIO; +import javax.swing.border.EmptyBorder; +import javax.swing.GroupLayout.Alignment; +import javax.swing.GroupLayout; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.SwingConstants; + +public class SnakeGame { + + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + GamelauncherMain frame = new GamelauncherMain(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + + } + +} + From cb1aa38288001b33652db7ac8329ae6ece8c493a Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:34:38 +0100 Subject: [PATCH 02/54] [SnakeGame Class]: added Content Pane --- .../JavaGamelauncher/SnakeGame.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 08cffc0..b041d58 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -33,7 +33,9 @@ import javax.swing.JPanel; import javax.swing.LayoutStyle.ComponentPlacement; import javax.swing.SwingConstants; -public class SnakeGame { +public class SnakeGame extends JFrame { + + private JPanel cP; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @@ -48,6 +50,15 @@ public class SnakeGame { }); } - + + public SnakeGame() { + setTitle("Snake"); + setBounds(0, 0, 1200, 600); + + cP = new JPanel(); + cP.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(cP); + cP.setLayout(null); + } } From a0a6d24f1eb2dcb7661ebe187871a8f07253c039 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:44:11 +0100 Subject: [PATCH 03/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20h=C3=B6he=20des=20Fensters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGameTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java new file mode 100644 index 0000000..4fac704 --- /dev/null +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -0,0 +1,17 @@ +package de.hs_fulda.gruppenprojekt.JavaGamelauncher; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class SnakeGameTest { + SnakeGame snek = new SnakeGame(); + @Test + public void test() { + assertTrue(true); + } + + public void hoeheTest() { + assertTrue(snek.hoehe == 600); + } +} From 5cca8b3217b9bb6e8d5bde6c499a89b1beb5d8ac Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:46:22 +0100 Subject: [PATCH 04/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20Breite=20des=20Fensters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 4fac704..4335aa5 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -14,4 +14,8 @@ public class SnakeGameTest { public void hoeheTest() { assertTrue(snek.hoehe == 600); } + + public void breiteTest() { + assertTrue(snek.breite == 1200); + } } From 5a3e08c5d5f36d722a8ba2a53a20e3e6dbb31306 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:48:06 +0100 Subject: [PATCH 05/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20Titel=20des=20Fensters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 4335aa5..bec49bb 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -18,4 +18,8 @@ public class SnakeGameTest { public void breiteTest() { assertTrue(snek.breite == 1200); } + + public void titelTest() { + assertTrue(snek.titel == "Snake"); + } } From aacd3b55a4eb41932c26eb16325db5e04b050fe7 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:51:55 +0100 Subject: [PATCH 06/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?der=20Panel=201&2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index b041d58..879407b 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -36,6 +36,12 @@ import javax.swing.SwingConstants; public class SnakeGame extends JFrame { private JPanel cP; + public JPanel panel1; + public JPanel panel2; + + public int breite = 1200; + public int hoehe = 600; + public String titel = "Snake"; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @@ -59,6 +65,20 @@ public class SnakeGame extends JFrame { cP.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(cP); cP.setLayout(null); + + panel1 = new JPanel(); + panel1.setBounds(300, 0, 100, 100); + panel1.setVisible(true); + panel1.setBackground(Color.BLACK); + + cP.add(panel1); + + panel2 = new JPanel(); + panel2.setBounds(400, 0, 100, 100); + panel2.setVisible(true); + panel2.setBackground(Color.BLACK); + + cP.add(panel2); } } From b06a0294c53746c3312c767aea9405e6fc77608a Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:53:09 +0100 Subject: [PATCH 07/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?der=20Panel=203&4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 879407b..5989a70 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -38,6 +38,8 @@ public class SnakeGame extends JFrame { private JPanel cP; public JPanel panel1; public JPanel panel2; + public JPanel panel3; + public JPanel panel4; public int breite = 1200; public int hoehe = 600; @@ -79,6 +81,20 @@ public class SnakeGame extends JFrame { panel2.setBackground(Color.BLACK); cP.add(panel2); + + panel3 = new JPanel(); + panel3.setBounds(500, 0, 100, 100); + panel3.setVisible(true); + panel3.setBackground(Color.BLACK); + + cP.add(panel3); + + panel4 = new JPanel(); + panel4.setBounds(600, 0, 100, 100); + panel4.setVisible(true); + panel4.setBackground(Color.BLACK); + + cP.add(panel4); } } From def9b358965f37cba43ee78e51e8a1ce92b96ee6 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 09:52:34 +0100 Subject: [PATCH 08/54] =?UTF-8?q?[SnakeGame=20Class]:=20Logik=20=C3=BCberd?= =?UTF-8?q?acht;=20weitere=20Variablen=20inizialisiert=20und=20definiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 5989a70..531256a 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -44,6 +44,8 @@ public class SnakeGame extends JFrame { public int breite = 1200; public int hoehe = 600; public String titel = "Snake"; + public int hoeheP = 100; + public int breiteP = 100; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { From b96ee9ff345d9b0133901a2be076e3bf5e202a7f Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 09:55:46 +0100 Subject: [PATCH 09/54] [SnakeGame Class]: Getter und setter Methoden zu allen Variablen erstellt --- .../JavaGamelauncher/SnakeGame.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 531256a..d673a1c 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -98,5 +98,78 @@ public class SnakeGame extends JFrame { cP.add(panel4); } + + public JPanel getPanel1() { + return panel1; + } + + public void setPanel1(JPanel panel1) { + this.panel1 = panel1; + } + + public JPanel getPanel2() { + return panel2; + } + + public void setPanel2(JPanel panel2) { + this.panel2 = panel2; + } + + public JPanel getPanel3() { + return panel3; + } + + public void setPanel3(JPanel panel3) { + this.panel3 = panel3; + } + + public JPanel getPanel4() { + return panel4; + } + + public void setPanel4(JPanel panel4) { + this.panel4 = panel4; + } + + public int getBreite() { + return breite; + } + + public void setBreite(int breite) { + this.breite = breite; + } + + public int getHoehe() { + return hoehe; + } + + public void setHoehe(int hoehe) { + this.hoehe = hoehe; + } + + public String getTitel() { + return titel; + } + + public void setTitel(String titel) { + this.titel = titel; + } + + public int getHoeheP() { + return hoeheP; + } + + public void setHoeheP(int hoeheP) { + this.hoeheP = hoeheP; + } + + public int getBreiteP() { + return breiteP; + } + + public void setBreiteP(int breiteP) { + this.breiteP = breiteP; + } + } From f750f2504373c8cc270c1e5aeec388d934147b47 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:13:23 +0100 Subject: [PATCH 10/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index d673a1c..defbc33 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -40,6 +40,7 @@ public class SnakeGame extends JFrame { public JPanel panel2; public JPanel panel3; public JPanel panel4; + public JPanel panel5; public int breite = 1200; public int hoehe = 600; @@ -97,6 +98,13 @@ public class SnakeGame extends JFrame { panel4.setBackground(Color.BLACK); cP.add(panel4); + + panel5 = new JPanel(); + panel5.setBounds(700, 0, 100, 100); + panel5.setVisible(true); + panel5.setBackground(Color.BLACK); + + cP.add(panel5); } public JPanel getPanel1() { From 8649c3f70c006207fbeb0008c4aa88fedebf9dd4 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:15:06 +0100 Subject: [PATCH 11/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?der=20Panel=206&7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index defbc33..4ba3f0e 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -41,6 +41,8 @@ public class SnakeGame extends JFrame { public JPanel panel3; public JPanel panel4; public JPanel panel5; + public JPanel panel6; + public JPanel panel7; public int breite = 1200; public int hoehe = 600; @@ -105,6 +107,20 @@ public class SnakeGame extends JFrame { panel5.setBackground(Color.BLACK); cP.add(panel5); + + panel6 = new JPanel(); + panel6.setBounds(800, 0, 100, 100); + panel6.setVisible(true); + panel6.setBackground(Color.BLACK); + + cP.add(panel6); + + panel7 = new JPanel(); + panel7.setBounds(300, 100, 100, 100); + panel7.setVisible(true); + panel7.setBackground(Color.BLACK); + + cP.add(panel7); } public JPanel getPanel1() { From a0d0b1db3e7594c18272690fd3ee39dd73eb3cba Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:19:49 +0100 Subject: [PATCH 12/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 43 +++++++------------ 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 4ba3f0e..a3054ed 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -1,37 +1,18 @@ package de.hs_fulda.gruppenprojekt.JavaGamelauncher; -import java.awt.AWTException; -import java.awt.BorderLayout; -import java.awt.CardLayout; +import java.io.*; import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.EventQueue; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.image.BufferedImage; -import java.awt.Image; -import java.awt.Taskbar; -import java.awt.Toolkit; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; +import java.io.BufferedReader; import java.io.IOException; -import java.lang.System.Logger.Level; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.logging.Logger; -import javax.imageio.ImageIO; -import javax.swing.border.EmptyBorder; -import javax.swing.GroupLayout.Alignment; -import javax.swing.GroupLayout; -import javax.swing.ImageIcon; -import javax.swing.JButton; +import java.io.InputStreamReader; +import java.io.Reader; + import javax.swing.JFrame; -import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.LayoutStyle.ComponentPlacement; -import javax.swing.SwingConstants; +import javax.swing.border.EmptyBorder; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; public class SnakeGame extends JFrame { @@ -43,6 +24,7 @@ public class SnakeGame extends JFrame { public JPanel panel5; public JPanel panel6; public JPanel panel7; + public JPanel panel8; public int breite = 1200; public int hoehe = 600; @@ -121,6 +103,13 @@ public class SnakeGame extends JFrame { panel7.setBackground(Color.BLACK); cP.add(panel7); + + panel8 = new JPanel(); + panel8.setBounds(400, 100, 100, 100); + panel8.setVisible(true); + panel8.setBackground(Color.BLUE); + + cP.add(panel8); } public JPanel getPanel1() { From df956196bf2b6a458f0e3599b357be3e630520f4 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:22:36 +0100 Subject: [PATCH 13/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?der=20Panel=209&10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index a3054ed..92bac68 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -25,6 +25,8 @@ public class SnakeGame extends JFrame { public JPanel panel6; public JPanel panel7; public JPanel panel8; + public JPanel panel9; + public JPanel panel10; public int breite = 1200; public int hoehe = 600; @@ -110,6 +112,20 @@ public class SnakeGame extends JFrame { panel8.setBackground(Color.BLUE); cP.add(panel8); + + panel9 = new JPanel(); + panel9.setBounds(500, 100, 100, 100); + panel9.setVisible(true); + panel9.setBackground(Color.BLACK); + + cP.add(panel9); + + panel10 = new JPanel(); + panel10.setBounds(600, 100, 100, 100); + panel10.setVisible(true); + panel10.setBackground(Color.BLACK); + + cP.add(panel10); } public JPanel getPanel1() { From 87f7705d529bfcfaa4cd8c249c21d58c653afade Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:24:30 +0100 Subject: [PATCH 14/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?der=20Panel=2011&12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 92bac68..9ce8249 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -27,6 +27,8 @@ public class SnakeGame extends JFrame { public JPanel panel8; public JPanel panel9; public JPanel panel10; + public JPanel panel11; + public JPanel panel12; public int breite = 1200; public int hoehe = 600; @@ -126,6 +128,20 @@ public class SnakeGame extends JFrame { panel10.setBackground(Color.BLACK); cP.add(panel10); + + panel11 = new JPanel(); + panel11.setBounds(700, 100, 100, 100); + panel11.setVisible(true); + panel11.setBackground(Color.BLACK); + + cP.add(panel11); + + panel12 = new JPanel(); + panel12.setBounds(800, 100, 100, 100); + panel12.setVisible(true); + panel12.setBackground(Color.BLACK); + + cP.add(panel12); } public JPanel getPanel1() { From 609e30379cbbef8f493a315536f314c18fa76cf4 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:25:53 +0100 Subject: [PATCH 15/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=2013?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 9ce8249..89a70c7 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -29,6 +29,7 @@ public class SnakeGame extends JFrame { public JPanel panel10; public JPanel panel11; public JPanel panel12; + public JPanel panel13; public int breite = 1200; public int hoehe = 600; @@ -142,6 +143,13 @@ public class SnakeGame extends JFrame { panel12.setBackground(Color.BLACK); cP.add(panel12); + + panel13 = new JPanel(); + panel13.setBounds(300, 200, 100, 100); + panel13.setVisible(true); + panel13.setBackground(Color.BLACK); + + cP.add(panel13); } public JPanel getPanel1() { From 646e178a60b5d1518d9b9e4f5054d9bb0a2a1214 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:30:00 +0100 Subject: [PATCH 16/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=2014?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 89a70c7..2951666 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -30,6 +30,7 @@ public class SnakeGame extends JFrame { public JPanel panel11; public JPanel panel12; public JPanel panel13; + public JPanel panel14; public int breite = 1200; public int hoehe = 600; @@ -150,6 +151,13 @@ public class SnakeGame extends JFrame { panel13.setBackground(Color.BLACK); cP.add(panel13); + + panel14 = new JPanel(); + panel14.setBounds(400, 200, 100, 100); + panel14.setVisible(true); + panel14.setBackground(Color.WHITE); + + cP.add(panel14); } public JPanel getPanel1() { From 4be5ba03dfc507141b3c2d1d776447e8d9be0bb4 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:31:12 +0100 Subject: [PATCH 17/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=2015?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 2951666..e5e5900 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -31,6 +31,7 @@ public class SnakeGame extends JFrame { public JPanel panel12; public JPanel panel13; public JPanel panel14; + public JPanel panel15; public int breite = 1200; public int hoehe = 600; @@ -158,6 +159,13 @@ public class SnakeGame extends JFrame { panel14.setBackground(Color.WHITE); cP.add(panel14); + + panel15 = new JPanel(); + panel15.setBounds(500, 200, 100, 100); + panel15.setVisible(true); + panel15.setBackground(Color.BLACK); + + cP.add(panel15); } public JPanel getPanel1() { From aa577cbae27a101ddaaeec8f729356e93fbfa9f9 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:32:41 +0100 Subject: [PATCH 18/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=2016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index e5e5900..7ddca0a 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -32,6 +32,7 @@ public class SnakeGame extends JFrame { public JPanel panel13; public JPanel panel14; public JPanel panel15; + public JPanel panel16; public int breite = 1200; public int hoehe = 600; @@ -166,6 +167,13 @@ public class SnakeGame extends JFrame { panel15.setBackground(Color.BLACK); cP.add(panel15); + + panel16 = new JPanel(); + panel16.setBounds(600, 200, 100, 100); + panel16.setVisible(true); + panel16.setBackground(Color.BLACK); + + cP.add(panel16); } public JPanel getPanel1() { From 0ded7c1370ea589beb29d8c9e671ed91ecf6b794 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:33:59 +0100 Subject: [PATCH 19/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=2017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 7ddca0a..ce7202f 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -33,6 +33,7 @@ public class SnakeGame extends JFrame { public JPanel panel14; public JPanel panel15; public JPanel panel16; + public JPanel panel17; public int breite = 1200; public int hoehe = 600; @@ -174,6 +175,13 @@ public class SnakeGame extends JFrame { panel16.setBackground(Color.BLACK); cP.add(panel16); + + panel17 = new JPanel(); + panel17.setBounds(700, 200, 100, 100); + panel17.setVisible(true); + panel17.setBackground(Color.BLACK); + + cP.add(panel17); } public JPanel getPanel1() { From 58469f74e58a46269ab423e10d69f7150e09497a Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:35:56 +0100 Subject: [PATCH 20/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?des=20Panels=2018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index ce7202f..d0faaa5 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -34,6 +34,7 @@ public class SnakeGame extends JFrame { public JPanel panel15; public JPanel panel16; public JPanel panel17; + public JPanel panel18; public int breite = 1200; public int hoehe = 600; @@ -182,6 +183,13 @@ public class SnakeGame extends JFrame { panel17.setBackground(Color.BLACK); cP.add(panel17); + + panel18 = new JPanel(); + panel18.setBounds(800, 200, 100, 100); + panel18.setVisible(true); + panel18.setBackground(Color.BLACK); + + cP.add(panel18); } public JPanel getPanel1() { From cc5da0e3ab24ae1351f869bd3b00d12f0693845e Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:07:31 +0100 Subject: [PATCH 21/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20Test=20f=C3=BC?= =?UTF-8?q?r=20h=C3=B6he=20des=20ersten=20Panels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index bec49bb..ae29c19 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -22,4 +22,10 @@ public class SnakeGameTest { public void titelTest() { assertTrue(snek.titel == "Snake"); } -} + + public void hoehePanelTest() { + int hoehe = 100; + assertTrue(snek.getHoeheP1() == hoehe ); + } + +} \ No newline at end of file From 19072b38f1cca61e1b31f61105b05bd38d0883b4 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:09:46 +0100 Subject: [PATCH 22/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20?= =?UTF-8?q?=20f=C3=BCr=20breite=20des=20ersten=20Panels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index ae29c19..02a54aa 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -28,4 +28,9 @@ public class SnakeGameTest { assertTrue(snek.getHoeheP1() == hoehe ); } + public void breitePanelTest() { + int breite = 100; + assertTrue(snek.getBreiteP1() == breite ); + } + } \ No newline at end of file From 73d967a09e639fa3cfd70b227f00e7c0479bb6bd Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:12:26 +0100 Subject: [PATCH 23/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?weiterer=20getter=20und=20setter=20methoden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 186 +++++++++++++++++- 1 file changed, 176 insertions(+), 10 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index d0faaa5..6c1a244 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -39,8 +39,14 @@ public class SnakeGame extends JFrame { public int breite = 1200; public int hoehe = 600; public String titel = "Snake"; - public int hoeheP = 100; - public int breiteP = 100; + public int hoeheP1 = 100; + public int breiteP1 = 100; + public int hoeheP2 = 100; + public int breiteP2 = 100; + public int hoeheP3 = 100; + public int breiteP3 = 100; + public int hoeheP4 = 100; + public int breiteP4 = 100; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @@ -240,6 +246,166 @@ public class SnakeGame extends JFrame { this.hoehe = hoehe; } + public JPanel getPanel5() { + return panel5; + } + + public void setPanel5(JPanel panel5) { + this.panel5 = panel5; + } + + public JPanel getPanel6() { + return panel6; + } + + public void setPanel6(JPanel panel6) { + this.panel6 = panel6; + } + + public JPanel getPanel7() { + return panel7; + } + + public void setPanel7(JPanel panel7) { + this.panel7 = panel7; + } + + public JPanel getPanel8() { + return panel8; + } + + public void setPanel8(JPanel panel8) { + this.panel8 = panel8; + } + + public JPanel getPanel9() { + return panel9; + } + + public void setPanel9(JPanel panel9) { + this.panel9 = panel9; + } + + public JPanel getPanel10() { + return panel10; + } + + public void setPanel10(JPanel panel10) { + this.panel10 = panel10; + } + + public JPanel getPanel11() { + return panel11; + } + + public void setPanel11(JPanel panel11) { + this.panel11 = panel11; + } + + public JPanel getPanel12() { + return panel12; + } + + public void setPanel12(JPanel panel12) { + this.panel12 = panel12; + } + + public JPanel getPanel13() { + return panel13; + } + + public void setPanel13(JPanel panel13) { + this.panel13 = panel13; + } + + public JPanel getPanel14() { + return panel14; + } + + public void setPanel14(JPanel panel14) { + this.panel14 = panel14; + } + + public JPanel getPanel15() { + return panel15; + } + + public void setPanel15(JPanel panel15) { + this.panel15 = panel15; + } + + public JPanel getPanel16() { + return panel16; + } + + public void setPanel16(JPanel panel16) { + this.panel16 = panel16; + } + + public JPanel getPanel17() { + return panel17; + } + + public void setPanel17(JPanel panel17) { + this.panel17 = panel17; + } + + public JPanel getPanel18() { + return panel18; + } + + public void setPanel18(JPanel panel18) { + this.panel18 = panel18; + } + + public int getHoeheP2() { + return hoeheP2; + } + + public void setHoeheP2(int hoeheP2) { + this.hoeheP2 = hoeheP2; + } + + public int getBreiteP2() { + return breiteP2; + } + + public void setBreiteP2(int breiteP2) { + this.breiteP2 = breiteP2; + } + + public int getHoeheP3() { + return hoeheP3; + } + + public void setHoeheP3(int hoeheP3) { + this.hoeheP3 = hoeheP3; + } + + public int getBreiteP3() { + return breiteP3; + } + + public void setBreiteP3(int breiteP3) { + this.breiteP3 = breiteP3; + } + + public int getHoeheP4() { + return hoeheP4; + } + + public void setHoeheP4(int hoeheP4) { + this.hoeheP4 = hoeheP4; + } + + public int getBreiteP4() { + return breiteP4; + } + + public void setBreiteP4(int breiteP4) { + this.breiteP4 = breiteP4; + } + public String getTitel() { return titel; } @@ -248,20 +414,20 @@ public class SnakeGame extends JFrame { this.titel = titel; } - public int getHoeheP() { - return hoeheP; + public int getHoeheP1() { + return hoeheP1; } - public void setHoeheP(int hoeheP) { - this.hoeheP = hoeheP; + public void setHoeheP1(int hoeheP) { + this.hoeheP1 = hoeheP; } - public int getBreiteP() { - return breiteP; + public int getBreiteP1() { + return breiteP1; } - public void setBreiteP(int breiteP) { - this.breiteP = breiteP; + public void setBreiteP1(int breiteP) { + this.breiteP1 = breiteP; } } From 0be6724637648f36532c01e1ea086f929513f5a7 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:19:49 +0100 Subject: [PATCH 24/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20h=C3=B6he=20des=20zweiten=20Panels=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 02a54aa..1c930e4 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -33,4 +33,9 @@ public class SnakeGameTest { assertTrue(snek.getBreiteP1() == breite ); } + public void hoehePane2Test() { + int hoehe = 100; + assertTrue(snek.getHoeheP2() == hoehe ); + } + } \ No newline at end of file From a568a9cdd04d46783559e3eb1bf551f4302f6166 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:21:19 +0100 Subject: [PATCH 25/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20breite=20des=20zweiten=20Panels=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 1c930e4..c4435c3 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -38,4 +38,9 @@ public class SnakeGameTest { assertTrue(snek.getHoeheP2() == hoehe ); } + public void breitePane2Test() { + int breite = 100; + assertTrue(snek.getBreiteP2() == breite ); + } + } \ No newline at end of file From c4ac218431cbdbe1dc7b5cd76dd7b19ca0820a60 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:23:20 +0100 Subject: [PATCH 26/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20h=C3=B6he=20des=20dritten=20Panels=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index c4435c3..9b7356f 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -43,4 +43,9 @@ public class SnakeGameTest { assertTrue(snek.getBreiteP2() == breite ); } + public void hoehePane3Test() { + int hoehe = 100; + assertTrue(snek.getHoeheP3() == hoehe ); + } + } \ No newline at end of file From d9a64961c5bc876b3999373e5c14be965a6827a0 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:25:09 +0100 Subject: [PATCH 27/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20breite=20des=20dritten=20Panels=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 9b7356f..bb9a7a3 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -48,4 +48,9 @@ public class SnakeGameTest { assertTrue(snek.getHoeheP3() == hoehe ); } + public void breitePane3Test() { + int breite = 100; + assertTrue(snek.getBreiteP3() == breite ); + } + } \ No newline at end of file From d8abcf34cdf9704fa77149fd3cac80261ca63afe Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:27:39 +0100 Subject: [PATCH 28/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20h=C3=B6he=20des=20vierten=20Panels=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index bb9a7a3..f763516 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -53,4 +53,9 @@ public class SnakeGameTest { assertTrue(snek.getBreiteP3() == breite ); } + public void hoehePane4Test() { + int hoehe = 100; + assertTrue(snek.getHoeheP4() == hoehe ); + } + } \ No newline at end of file From d21591e69b32e43a38957c3a4c526b0c92f8849b Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:29:15 +0100 Subject: [PATCH 29/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20breite=20des=20vierten=20Panels=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index f763516..fef85cb 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -58,4 +58,9 @@ public class SnakeGameTest { assertTrue(snek.getHoeheP4() == hoehe ); } + public void breitePane4Test() { + int breite = 100; + assertTrue(snek.getBreiteP4() == breite ); + } + } \ No newline at end of file From 3ffb485328a791c1ba054476636d2f33bc9c0eee Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:38:05 +0100 Subject: [PATCH 30/54] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20?= =?UTF-8?q?der=20Panel=2019=20-=2036?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 220 ++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 6c1a244..67617de 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -35,6 +35,24 @@ public class SnakeGame extends JFrame { public JPanel panel16; public JPanel panel17; public JPanel panel18; + public JPanel panel19; + public JPanel panel20; + public JPanel panel21; + public JPanel panel22; + public JPanel panel23; + public JPanel panel24; + public JPanel panel25; + public JPanel panel26; + public JPanel panel27; + public JPanel panel28; + public JPanel panel29; + public JPanel panel30; + public JPanel panel31; + public JPanel panel32; + public JPanel panel33; + public JPanel panel34; + public JPanel panel35; + public JPanel panel36; public int breite = 1200; public int hoehe = 600; @@ -47,6 +65,12 @@ public class SnakeGame extends JFrame { public int breiteP3 = 100; public int hoeheP4 = 100; public int breiteP4 = 100; + public int xCords1 = 300; + public int xCords2 = 400; + public int xCords3 = 500; + public int xCords4 = 600; + public int xCords5 = 700; + public int xCords6 = 800; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @@ -196,6 +220,202 @@ public class SnakeGame extends JFrame { panel18.setBackground(Color.BLACK); cP.add(panel18); + + panel9 = new JPanel(); + panel9.setBounds(500, 100, 100, 100); + panel9.setVisible(true); + panel9.setBackground(Color.BLACK); + + cP.add(panel9); + + panel10 = new JPanel(); + panel10.setBounds(600, 100, 100, 100); + panel10.setVisible(true); + panel10.setBackground(Color.BLACK); + + cP.add(panel10); + + panel11 = new JPanel(); + panel11.setBounds(700, 100, 100, 100); + panel11.setVisible(true); + panel11.setBackground(Color.BLACK); + + cP.add(panel11); + + panel12 = new JPanel(); + panel12.setBounds(800, 100, 100, 100); + panel12.setVisible(true); + panel12.setBackground(Color.BLACK); + + cP.add(panel12); + + panel13 = new JPanel(); + panel13.setBounds(300, 200, 100, 100); + panel13.setVisible(true); + panel13.setBackground(Color.BLACK); + + cP.add(panel13); + + panel14 = new JPanel(); + panel14.setBounds(400, 200, 100, 100); + panel14.setVisible(true); + panel14.setBackground(Color.WHITE); + + cP.add(panel14); + + panel15 = new JPanel(); + panel15.setBounds(500, 200, 100, 100); + panel15.setVisible(true); + panel15.setBackground(Color.BLACK); + + cP.add(panel15); + + panel16 = new JPanel(); + panel16.setBounds(600, 200, 100, 100); + panel16.setVisible(true); + panel16.setBackground(Color.BLACK); + + cP.add(panel16); + + panel17 = new JPanel(); + panel17.setBounds(700, 200, 100, 100); + panel17.setVisible(true); + panel17.setBackground(Color.BLACK); + + cP.add(panel17); + + panel18 = new JPanel(); + panel18.setBounds(800, 200, 100, 100); + panel18.setVisible(true); + panel18.setBackground(Color.BLACK); + + cP.add(panel18); + + panel19 = new JPanel(); + panel19.setBounds(300, 300, 100, 100); + panel19.setVisible(true); + panel19.setBackground(Color.BLACK); + + cP.add(panel19); + + panel20 = new JPanel(); + panel20.setBounds(400, 300, 100, 100); + panel20.setVisible(true); + panel20.setBackground(Color.WHITE); + + cP.add(panel20); + + panel21 = new JPanel(); + panel21.setBounds(500, 300, 100, 100); + panel21.setVisible(true); + panel21.setBackground(Color.BLACK); + + cP.add(panel21); + + panel22 = new JPanel(); + panel22.setBounds(600, 300, 100, 100); + panel22.setVisible(true); + panel22.setBackground(Color.BLACK); + + cP.add(panel22); + + panel23 = new JPanel(); + panel23.setBounds(700, 300, 100, 100); + panel23.setVisible(true); + panel23.setBackground(Color.BLACK); + + cP.add(panel23); + + panel24 = new JPanel(); + panel24.setBounds(800, 300, 100, 100); + panel24.setVisible(true); + panel24.setBackground(Color.BLACK); + + cP.add(panel24); + + panel25 = new JPanel(); + panel25.setBounds(300, 400, 100, 100); + panel25.setVisible(true); + panel25.setBackground(Color.BLACK); + + cP.add(panel25); + + panel26 = new JPanel(); + panel26.setBounds(400, 400, 100, 100); + panel26.setVisible(true); + panel26.setBackground(Color.BLACK); + + cP.add(panel26); + + panel27 = new JPanel(); + panel27.setBounds(500, 400, 100, 100); + panel27.setVisible(true); + panel27.setBackground(Color.BLACK); + + cP.add(panel27); + + panel28 = new JPanel(); + panel28.setBounds(600, 400, 100, 100); + panel28.setVisible(true); + panel28.setBackground(Color.BLACK); + + cP.add(panel28); + + panel29 = new JPanel(); + panel29.setBounds(700, 400, 100, 100); + panel29.setVisible(true); + panel29.setBackground(Color.BLACK); + + cP.add(panel29); + + panel30 = new JPanel(); + panel30.setBounds(800, 400, 100, 100); + panel30.setVisible(true); + panel30.setBackground(Color.BLACK); + + cP.add(panel30); + + panel31 = new JPanel(); + panel31.setBounds(300, 500, 100, 100); + panel31.setVisible(true); + panel31.setBackground(Color.BLACK); + + cP.add(panel31); + + panel32 = new JPanel(); + panel32.setBounds(400, 500, 100, 100); + panel32.setVisible(true); + panel32.setBackground(Color.BLACK); + + cP.add(panel32); + + panel33 = new JPanel(); + panel33.setBounds(500, 500, 100, 100); + panel33.setVisible(true); + panel33.setBackground(Color.BLACK); + + cP.add(panel33); + + panel34 = new JPanel(); + panel34.setBounds(600, 500, 100, 100); + panel34.setVisible(true); + panel34.setBackground(Color.BLACK); + + cP.add(panel34); + + panel35 = new JPanel(); + panel35.setBounds(700, 500, 100, 100); + panel35.setVisible(true); + panel35.setBackground(Color.BLACK); + + cP.add(panel35); + + panel36 = new JPanel(); + panel36.setBounds(800, 500, 100, 100); + panel36.setVisible(true); + panel36.setBackground(Color.BLACK); + + cP.add(panel36); } public JPanel getPanel1() { From aaa9c506457633ac8b6bf308a2bddd8d14164b14 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:46:09 +0100 Subject: [PATCH 31/54] refactoring:[SnakeGame Class]: xCords1 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 67617de..9e8560f 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -96,7 +96,7 @@ public class SnakeGame extends JFrame { cP.setLayout(null); panel1 = new JPanel(); - panel1.setBounds(300, 0, 100, 100); + panel1.setBounds(xCords1, 0, 100, 100); panel1.setVisible(true); panel1.setBackground(Color.BLACK); @@ -138,7 +138,7 @@ public class SnakeGame extends JFrame { cP.add(panel6); panel7 = new JPanel(); - panel7.setBounds(300, 100, 100, 100); + panel7.setBounds(xCords1, 100, 100, 100); panel7.setVisible(true); panel7.setBackground(Color.BLACK); @@ -180,7 +180,7 @@ public class SnakeGame extends JFrame { cP.add(panel12); panel13 = new JPanel(); - panel13.setBounds(300, 200, 100, 100); + panel13.setBounds(xCords1, 200, 100, 100); panel13.setVisible(true); panel13.setBackground(Color.BLACK); @@ -250,7 +250,7 @@ public class SnakeGame extends JFrame { cP.add(panel12); panel13 = new JPanel(); - panel13.setBounds(300, 200, 100, 100); + panel13.setBounds(xCords1, 200, 100, 100); panel13.setVisible(true); panel13.setBackground(Color.BLACK); @@ -292,7 +292,7 @@ public class SnakeGame extends JFrame { cP.add(panel18); panel19 = new JPanel(); - panel19.setBounds(300, 300, 100, 100); + panel19.setBounds(xCords1, 300, 100, 100); panel19.setVisible(true); panel19.setBackground(Color.BLACK); @@ -334,7 +334,7 @@ public class SnakeGame extends JFrame { cP.add(panel24); panel25 = new JPanel(); - panel25.setBounds(300, 400, 100, 100); + panel25.setBounds(xCords1, 400, 100, 100); panel25.setVisible(true); panel25.setBackground(Color.BLACK); @@ -376,7 +376,7 @@ public class SnakeGame extends JFrame { cP.add(panel30); panel31 = new JPanel(); - panel31.setBounds(300, 500, 100, 100); + panel31.setBounds(xCords1, 500, 100, 100); panel31.setVisible(true); panel31.setBackground(Color.BLACK); From 6b17f1e8a96e685c20d5ce2a875abe5ff35bcaeb Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:49:22 +0100 Subject: [PATCH 32/54] refactoring:[SnakeGame Class]: xCords2 ausgelagert --- .../JavaGamelauncher/SnakeGame.java | 82 ++----------------- 1 file changed, 6 insertions(+), 76 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 9e8560f..9b41848 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -103,7 +103,7 @@ public class SnakeGame extends JFrame { cP.add(panel1); panel2 = new JPanel(); - panel2.setBounds(400, 0, 100, 100); + panel2.setBounds(xCords2, 0, 100, 100); panel2.setVisible(true); panel2.setBackground(Color.BLACK); @@ -145,7 +145,7 @@ public class SnakeGame extends JFrame { cP.add(panel7); panel8 = new JPanel(); - panel8.setBounds(400, 100, 100, 100); + panel8.setBounds(xCords2, 100, 100, 100); panel8.setVisible(true); panel8.setBackground(Color.BLUE); @@ -187,77 +187,7 @@ public class SnakeGame extends JFrame { cP.add(panel13); panel14 = new JPanel(); - panel14.setBounds(400, 200, 100, 100); - panel14.setVisible(true); - panel14.setBackground(Color.WHITE); - - cP.add(panel14); - - panel15 = new JPanel(); - panel15.setBounds(500, 200, 100, 100); - panel15.setVisible(true); - panel15.setBackground(Color.BLACK); - - cP.add(panel15); - - panel16 = new JPanel(); - panel16.setBounds(600, 200, 100, 100); - panel16.setVisible(true); - panel16.setBackground(Color.BLACK); - - cP.add(panel16); - - panel17 = new JPanel(); - panel17.setBounds(700, 200, 100, 100); - panel17.setVisible(true); - panel17.setBackground(Color.BLACK); - - cP.add(panel17); - - panel18 = new JPanel(); - panel18.setBounds(800, 200, 100, 100); - panel18.setVisible(true); - panel18.setBackground(Color.BLACK); - - cP.add(panel18); - - panel9 = new JPanel(); - panel9.setBounds(500, 100, 100, 100); - panel9.setVisible(true); - panel9.setBackground(Color.BLACK); - - cP.add(panel9); - - panel10 = new JPanel(); - panel10.setBounds(600, 100, 100, 100); - panel10.setVisible(true); - panel10.setBackground(Color.BLACK); - - cP.add(panel10); - - panel11 = new JPanel(); - panel11.setBounds(700, 100, 100, 100); - panel11.setVisible(true); - panel11.setBackground(Color.BLACK); - - cP.add(panel11); - - panel12 = new JPanel(); - panel12.setBounds(800, 100, 100, 100); - panel12.setVisible(true); - panel12.setBackground(Color.BLACK); - - cP.add(panel12); - - panel13 = new JPanel(); - panel13.setBounds(xCords1, 200, 100, 100); - panel13.setVisible(true); - panel13.setBackground(Color.BLACK); - - cP.add(panel13); - - panel14 = new JPanel(); - panel14.setBounds(400, 200, 100, 100); + panel14.setBounds(xCords2, 200, 100, 100); panel14.setVisible(true); panel14.setBackground(Color.WHITE); @@ -299,7 +229,7 @@ public class SnakeGame extends JFrame { cP.add(panel19); panel20 = new JPanel(); - panel20.setBounds(400, 300, 100, 100); + panel20.setBounds(xCords2, 300, 100, 100); panel20.setVisible(true); panel20.setBackground(Color.WHITE); @@ -341,7 +271,7 @@ public class SnakeGame extends JFrame { cP.add(panel25); panel26 = new JPanel(); - panel26.setBounds(400, 400, 100, 100); + panel26.setBounds(xCords2, 400, 100, 100); panel26.setVisible(true); panel26.setBackground(Color.BLACK); @@ -383,7 +313,7 @@ public class SnakeGame extends JFrame { cP.add(panel31); panel32 = new JPanel(); - panel32.setBounds(400, 500, 100, 100); + panel32.setBounds(xCords2, 500, 100, 100); panel32.setVisible(true); panel32.setBackground(Color.BLACK); From 5a8949f8b7937bc4ebf99ddd14ee7a790e56f474 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:51:46 +0100 Subject: [PATCH 33/54] refactoring:[SnakeGame Class]: xCords3 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 9b41848..e612dc5 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -110,7 +110,7 @@ public class SnakeGame extends JFrame { cP.add(panel2); panel3 = new JPanel(); - panel3.setBounds(500, 0, 100, 100); + panel3.setBounds(xCords3, 0, 100, 100); panel3.setVisible(true); panel3.setBackground(Color.BLACK); @@ -152,7 +152,7 @@ public class SnakeGame extends JFrame { cP.add(panel8); panel9 = new JPanel(); - panel9.setBounds(500, 100, 100, 100); + panel9.setBounds(xCords3, 100, 100, 100); panel9.setVisible(true); panel9.setBackground(Color.BLACK); @@ -194,7 +194,7 @@ public class SnakeGame extends JFrame { cP.add(panel14); panel15 = new JPanel(); - panel15.setBounds(500, 200, 100, 100); + panel15.setBounds(xCords3, 200, 100, 100); panel15.setVisible(true); panel15.setBackground(Color.BLACK); @@ -236,7 +236,7 @@ public class SnakeGame extends JFrame { cP.add(panel20); panel21 = new JPanel(); - panel21.setBounds(500, 300, 100, 100); + panel21.setBounds(xCords3, 300, 100, 100); panel21.setVisible(true); panel21.setBackground(Color.BLACK); @@ -278,7 +278,7 @@ public class SnakeGame extends JFrame { cP.add(panel26); panel27 = new JPanel(); - panel27.setBounds(500, 400, 100, 100); + panel27.setBounds(xCords3, 400, 100, 100); panel27.setVisible(true); panel27.setBackground(Color.BLACK); @@ -320,7 +320,7 @@ public class SnakeGame extends JFrame { cP.add(panel32); panel33 = new JPanel(); - panel33.setBounds(500, 500, 100, 100); + panel33.setBounds(xCords3, 500, 100, 100); panel33.setVisible(true); panel33.setBackground(Color.BLACK); From 7fa1f6df6f519549d10fb05cc674a188c316c895 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:54:53 +0100 Subject: [PATCH 34/54] refactoring:[SnakeGame Class]: xCords4 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index e612dc5..1c92fec 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -117,7 +117,7 @@ public class SnakeGame extends JFrame { cP.add(panel3); panel4 = new JPanel(); - panel4.setBounds(600, 0, 100, 100); + panel4.setBounds(xCords4, 0, 100, 100); panel4.setVisible(true); panel4.setBackground(Color.BLACK); @@ -159,7 +159,7 @@ public class SnakeGame extends JFrame { cP.add(panel9); panel10 = new JPanel(); - panel10.setBounds(600, 100, 100, 100); + panel10.setBounds(xCords4, 100, 100, 100); panel10.setVisible(true); panel10.setBackground(Color.BLACK); @@ -201,7 +201,7 @@ public class SnakeGame extends JFrame { cP.add(panel15); panel16 = new JPanel(); - panel16.setBounds(600, 200, 100, 100); + panel16.setBounds(xCords4, 200, 100, 100); panel16.setVisible(true); panel16.setBackground(Color.BLACK); @@ -243,7 +243,7 @@ public class SnakeGame extends JFrame { cP.add(panel21); panel22 = new JPanel(); - panel22.setBounds(600, 300, 100, 100); + panel22.setBounds(xCords4, 300, 100, 100); panel22.setVisible(true); panel22.setBackground(Color.BLACK); @@ -285,7 +285,7 @@ public class SnakeGame extends JFrame { cP.add(panel27); panel28 = new JPanel(); - panel28.setBounds(600, 400, 100, 100); + panel28.setBounds(xCords4, 400, 100, 100); panel28.setVisible(true); panel28.setBackground(Color.BLACK); @@ -327,7 +327,7 @@ public class SnakeGame extends JFrame { cP.add(panel33); panel34 = new JPanel(); - panel34.setBounds(600, 500, 100, 100); + panel34.setBounds(xCords4, 500, 100, 100); panel34.setVisible(true); panel34.setBackground(Color.BLACK); From 45d5637a12b1057511886280e792b0959fb463a6 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 10:58:27 +0100 Subject: [PATCH 35/54] refactoring:[SnakeGame Class]: xCords5 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 1c92fec..7f3aad2 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -124,7 +124,7 @@ public class SnakeGame extends JFrame { cP.add(panel4); panel5 = new JPanel(); - panel5.setBounds(700, 0, 100, 100); + panel5.setBounds(xCords5, 0, 100, 100); panel5.setVisible(true); panel5.setBackground(Color.BLACK); @@ -166,7 +166,7 @@ public class SnakeGame extends JFrame { cP.add(panel10); panel11 = new JPanel(); - panel11.setBounds(700, 100, 100, 100); + panel11.setBounds(xCords5, 100, 100, 100); panel11.setVisible(true); panel11.setBackground(Color.BLACK); @@ -208,7 +208,7 @@ public class SnakeGame extends JFrame { cP.add(panel16); panel17 = new JPanel(); - panel17.setBounds(700, 200, 100, 100); + panel17.setBounds(xCords5, 200, 100, 100); panel17.setVisible(true); panel17.setBackground(Color.BLACK); @@ -250,7 +250,7 @@ public class SnakeGame extends JFrame { cP.add(panel22); panel23 = new JPanel(); - panel23.setBounds(700, 300, 100, 100); + panel23.setBounds(xCords5, 300, 100, 100); panel23.setVisible(true); panel23.setBackground(Color.BLACK); @@ -292,7 +292,7 @@ public class SnakeGame extends JFrame { cP.add(panel28); panel29 = new JPanel(); - panel29.setBounds(700, 400, 100, 100); + panel29.setBounds(xCords5, 400, 100, 100); panel29.setVisible(true); panel29.setBackground(Color.BLACK); @@ -334,7 +334,7 @@ public class SnakeGame extends JFrame { cP.add(panel34); panel35 = new JPanel(); - panel35.setBounds(700, 500, 100, 100); + panel35.setBounds(xCords5, 500, 100, 100); panel35.setVisible(true); panel35.setBackground(Color.BLACK); From 9428c1496d42f778e1aed32098e076d6bf3fd27e Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:00:06 +0100 Subject: [PATCH 36/54] refactoring:[SnakeGame Class]: xCords6 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 7f3aad2..a0cee8f 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -131,7 +131,7 @@ public class SnakeGame extends JFrame { cP.add(panel5); panel6 = new JPanel(); - panel6.setBounds(800, 0, 100, 100); + panel6.setBounds(xCords6, 0, 100, 100); panel6.setVisible(true); panel6.setBackground(Color.BLACK); @@ -173,7 +173,7 @@ public class SnakeGame extends JFrame { cP.add(panel11); panel12 = new JPanel(); - panel12.setBounds(800, 100, 100, 100); + panel12.setBounds(xCords6, 100, 100, 100); panel12.setVisible(true); panel12.setBackground(Color.BLACK); @@ -215,7 +215,7 @@ public class SnakeGame extends JFrame { cP.add(panel17); panel18 = new JPanel(); - panel18.setBounds(800, 200, 100, 100); + panel18.setBounds(xCords6, 200, 100, 100); panel18.setVisible(true); panel18.setBackground(Color.BLACK); @@ -257,7 +257,7 @@ public class SnakeGame extends JFrame { cP.add(panel23); panel24 = new JPanel(); - panel24.setBounds(800, 300, 100, 100); + panel24.setBounds(xCords6, 300, 100, 100); panel24.setVisible(true); panel24.setBackground(Color.BLACK); @@ -299,7 +299,7 @@ public class SnakeGame extends JFrame { cP.add(panel29); panel30 = new JPanel(); - panel30.setBounds(800, 400, 100, 100); + panel30.setBounds(xCords6, 400, 100, 100); panel30.setVisible(true); panel30.setBackground(Color.BLACK); @@ -341,7 +341,7 @@ public class SnakeGame extends JFrame { cP.add(panel35); panel36 = new JPanel(); - panel36.setBounds(800, 500, 100, 100); + panel36.setBounds(xCords6, 500, 100, 100); panel36.setVisible(true); panel36.setBackground(Color.BLACK); From 08b2939600c2b3877cf02ad8380c46cd847c13c9 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:05:14 +0100 Subject: [PATCH 37/54] refactoring:[SnakeGame Class]: yCords1 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index a0cee8f..9656ff6 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -71,6 +71,7 @@ public class SnakeGame extends JFrame { public int xCords4 = 600; public int xCords5 = 700; public int xCords6 = 800; + public int yCords1 = 0; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @@ -96,42 +97,42 @@ public class SnakeGame extends JFrame { cP.setLayout(null); panel1 = new JPanel(); - panel1.setBounds(xCords1, 0, 100, 100); + panel1.setBounds(xCords1, yCords1, 100, 100); panel1.setVisible(true); panel1.setBackground(Color.BLACK); cP.add(panel1); panel2 = new JPanel(); - panel2.setBounds(xCords2, 0, 100, 100); + panel2.setBounds(xCords2, yCords1, 100, 100); panel2.setVisible(true); panel2.setBackground(Color.BLACK); cP.add(panel2); panel3 = new JPanel(); - panel3.setBounds(xCords3, 0, 100, 100); + panel3.setBounds(xCords3, yCords1, 100, 100); panel3.setVisible(true); panel3.setBackground(Color.BLACK); cP.add(panel3); panel4 = new JPanel(); - panel4.setBounds(xCords4, 0, 100, 100); + panel4.setBounds(xCords4, yCords1, 100, 100); panel4.setVisible(true); panel4.setBackground(Color.BLACK); cP.add(panel4); panel5 = new JPanel(); - panel5.setBounds(xCords5, 0, 100, 100); + panel5.setBounds(xCords5, yCords1, 100, 100); panel5.setVisible(true); panel5.setBackground(Color.BLACK); cP.add(panel5); panel6 = new JPanel(); - panel6.setBounds(xCords6, 0, 100, 100); + panel6.setBounds(xCords6, yCords1, 100, 100); panel6.setVisible(true); panel6.setBackground(Color.BLACK); From 12b3aa5af2ba75d169c110353bf43eaf8c36dce5 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:16:09 +0100 Subject: [PATCH 38/54] refactoring:[SnakeGame Class]: yCords2 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 9656ff6..39156db 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -72,6 +72,8 @@ public class SnakeGame extends JFrame { public int xCords5 = 700; public int xCords6 = 800; public int yCords1 = 0; + public int yCords2 = 100; + public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @@ -139,42 +141,42 @@ public class SnakeGame extends JFrame { cP.add(panel6); panel7 = new JPanel(); - panel7.setBounds(xCords1, 100, 100, 100); + panel7.setBounds(xCords1, yCords2, 100, 100); panel7.setVisible(true); panel7.setBackground(Color.BLACK); cP.add(panel7); panel8 = new JPanel(); - panel8.setBounds(xCords2, 100, 100, 100); + panel8.setBounds(xCords2, yCords2, 100, 100); panel8.setVisible(true); panel8.setBackground(Color.BLUE); cP.add(panel8); panel9 = new JPanel(); - panel9.setBounds(xCords3, 100, 100, 100); + panel9.setBounds(xCords3, yCords2, 100, 100); panel9.setVisible(true); panel9.setBackground(Color.BLACK); cP.add(panel9); panel10 = new JPanel(); - panel10.setBounds(xCords4, 100, 100, 100); + panel10.setBounds(xCords4, yCords2, 100, 100); panel10.setVisible(true); panel10.setBackground(Color.BLACK); cP.add(panel10); panel11 = new JPanel(); - panel11.setBounds(xCords5, 100, 100, 100); + panel11.setBounds(xCords5, yCords2, 100, 100); panel11.setVisible(true); panel11.setBackground(Color.BLACK); cP.add(panel11); panel12 = new JPanel(); - panel12.setBounds(xCords6, 100, 100, 100); + panel12.setBounds(xCords6, yCords2, 100, 100); panel12.setVisible(true); panel12.setBackground(Color.BLACK); From c4588dffb7298123a24c673729643504d92ed0df Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:18:34 +0100 Subject: [PATCH 39/54] refactoring:[SnakeGame Class]: yCords3 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 39156db..b56419e 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -73,6 +73,7 @@ public class SnakeGame extends JFrame { public int xCords6 = 800; public int yCords1 = 0; public int yCords2 = 100; + public int yCords3 = 200; public static void main(String[] args) { @@ -183,42 +184,42 @@ public class SnakeGame extends JFrame { cP.add(panel12); panel13 = new JPanel(); - panel13.setBounds(xCords1, 200, 100, 100); + panel13.setBounds(xCords1, yCords3, 100, 100); panel13.setVisible(true); panel13.setBackground(Color.BLACK); cP.add(panel13); panel14 = new JPanel(); - panel14.setBounds(xCords2, 200, 100, 100); + panel14.setBounds(xCords2, yCords3, 100, 100); panel14.setVisible(true); panel14.setBackground(Color.WHITE); cP.add(panel14); panel15 = new JPanel(); - panel15.setBounds(xCords3, 200, 100, 100); + panel15.setBounds(xCords3, yCords3, 100, 100); panel15.setVisible(true); panel15.setBackground(Color.BLACK); cP.add(panel15); panel16 = new JPanel(); - panel16.setBounds(xCords4, 200, 100, 100); + panel16.setBounds(xCords4, yCords3, 100, 100); panel16.setVisible(true); panel16.setBackground(Color.BLACK); cP.add(panel16); panel17 = new JPanel(); - panel17.setBounds(xCords5, 200, 100, 100); + panel17.setBounds(xCords5, yCords3, 100, 100); panel17.setVisible(true); panel17.setBackground(Color.BLACK); cP.add(panel17); panel18 = new JPanel(); - panel18.setBounds(xCords6, 200, 100, 100); + panel18.setBounds(xCords6, yCords3, 100, 100); panel18.setVisible(true); panel18.setBackground(Color.BLACK); From 184bf7baed67581aaf9bb85f06de424bb1c9c9e6 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:20:45 +0100 Subject: [PATCH 40/54] refactoring:[SnakeGame Class]: yCords4 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index b56419e..d11f882 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -74,6 +74,7 @@ public class SnakeGame extends JFrame { public int yCords1 = 0; public int yCords2 = 100; public int yCords3 = 200; + public int yCords4 = 300; public static void main(String[] args) { @@ -226,42 +227,42 @@ public class SnakeGame extends JFrame { cP.add(panel18); panel19 = new JPanel(); - panel19.setBounds(xCords1, 300, 100, 100); + panel19.setBounds(xCords1, yCords4, 100, 100); panel19.setVisible(true); panel19.setBackground(Color.BLACK); cP.add(panel19); panel20 = new JPanel(); - panel20.setBounds(xCords2, 300, 100, 100); + panel20.setBounds(xCords2, yCords4, 100, 100); panel20.setVisible(true); panel20.setBackground(Color.WHITE); cP.add(panel20); panel21 = new JPanel(); - panel21.setBounds(xCords3, 300, 100, 100); + panel21.setBounds(xCords3, yCords4, 100, 100); panel21.setVisible(true); panel21.setBackground(Color.BLACK); cP.add(panel21); panel22 = new JPanel(); - panel22.setBounds(xCords4, 300, 100, 100); + panel22.setBounds(xCords4, yCords4, 100, 100); panel22.setVisible(true); panel22.setBackground(Color.BLACK); cP.add(panel22); panel23 = new JPanel(); - panel23.setBounds(xCords5, 300, 100, 100); + panel23.setBounds(xCords5, yCords4, 100, 100); panel23.setVisible(true); panel23.setBackground(Color.BLACK); cP.add(panel23); panel24 = new JPanel(); - panel24.setBounds(xCords6, 300, 100, 100); + panel24.setBounds(xCords6, yCords4, 100, 100); panel24.setVisible(true); panel24.setBackground(Color.BLACK); From 0ef9f4c2bc53758a0744e3784d1665a42b8642d7 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:24:43 +0100 Subject: [PATCH 41/54] refactoring:[SnakeGame Class]: yCords5 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index d11f882..5b1710f 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -75,6 +75,7 @@ public class SnakeGame extends JFrame { public int yCords2 = 100; public int yCords3 = 200; public int yCords4 = 300; + public int yCords5 = 400; public static void main(String[] args) { @@ -269,42 +270,42 @@ public class SnakeGame extends JFrame { cP.add(panel24); panel25 = new JPanel(); - panel25.setBounds(xCords1, 400, 100, 100); + panel25.setBounds(xCords1, yCords5, 100, 100); panel25.setVisible(true); panel25.setBackground(Color.BLACK); cP.add(panel25); panel26 = new JPanel(); - panel26.setBounds(xCords2, 400, 100, 100); + panel26.setBounds(xCords2, yCords5, 100, 100); panel26.setVisible(true); panel26.setBackground(Color.BLACK); cP.add(panel26); panel27 = new JPanel(); - panel27.setBounds(xCords3, 400, 100, 100); + panel27.setBounds(xCords3, yCords5, 100, 100); panel27.setVisible(true); panel27.setBackground(Color.BLACK); cP.add(panel27); panel28 = new JPanel(); - panel28.setBounds(xCords4, 400, 100, 100); + panel28.setBounds(xCords4, yCords5, 100, 100); panel28.setVisible(true); panel28.setBackground(Color.BLACK); cP.add(panel28); panel29 = new JPanel(); - panel29.setBounds(xCords5, 400, 100, 100); + panel29.setBounds(xCords5, yCords5, 100, 100); panel29.setVisible(true); panel29.setBackground(Color.BLACK); cP.add(panel29); panel30 = new JPanel(); - panel30.setBounds(xCords6, 400, 100, 100); + panel30.setBounds(xCords6, yCords5, 100, 100); panel30.setVisible(true); panel30.setBackground(Color.BLACK); From 7636bf34cbf08c8764f55fbb50cb700fdf93b887 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:25:23 +0100 Subject: [PATCH 42/54] refactoring:[SnakeGame Class]: yCords6 ausgelagert --- .../gruppenprojekt/JavaGamelauncher/SnakeGame.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 5b1710f..00fbe77 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -76,6 +76,7 @@ public class SnakeGame extends JFrame { public int yCords3 = 200; public int yCords4 = 300; public int yCords5 = 400; + public int yCords6 = 500; public static void main(String[] args) { @@ -312,42 +313,42 @@ public class SnakeGame extends JFrame { cP.add(panel30); panel31 = new JPanel(); - panel31.setBounds(xCords1, 500, 100, 100); + panel31.setBounds(xCords1, yCords6, 100, 100); panel31.setVisible(true); panel31.setBackground(Color.BLACK); cP.add(panel31); panel32 = new JPanel(); - panel32.setBounds(xCords2, 500, 100, 100); + panel32.setBounds(xCords2, yCords6, 100, 100); panel32.setVisible(true); panel32.setBackground(Color.BLACK); cP.add(panel32); panel33 = new JPanel(); - panel33.setBounds(xCords3, 500, 100, 100); + panel33.setBounds(xCords3, yCords6, 100, 100); panel33.setVisible(true); panel33.setBackground(Color.BLACK); cP.add(panel33); panel34 = new JPanel(); - panel34.setBounds(xCords4, 500, 100, 100); + panel34.setBounds(xCords4, yCords6, 100, 100); panel34.setVisible(true); panel34.setBackground(Color.BLACK); cP.add(panel34); panel35 = new JPanel(); - panel35.setBounds(xCords5, 500, 100, 100); + panel35.setBounds(xCords5, yCords6, 100, 100); panel35.setVisible(true); panel35.setBackground(Color.BLACK); cP.add(panel35); panel36 = new JPanel(); - panel36.setBounds(xCords6, 500, 100, 100); + panel36.setBounds(xCords6, yCords6, 100, 100); panel36.setVisible(true); panel36.setBackground(Color.BLACK); From 33fd59321c2e756a0907889bdbcefb0062626044 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:39:18 +0100 Subject: [PATCH 43/54] =?UTF-8?q?[SnakeGame=20Class]:=20weitere=20getter?= =?UTF-8?q?=20und=20setter=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 00fbe77..b44d461 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -355,6 +355,246 @@ public class SnakeGame extends JFrame { cP.add(panel36); } + public JPanel getPanel19() { + return panel19; + } + + public void setPanel19(JPanel panel19) { + this.panel19 = panel19; + } + + public JPanel getPanel20() { + return panel20; + } + + public void setPanel20(JPanel panel20) { + this.panel20 = panel20; + } + + public JPanel getPanel21() { + return panel21; + } + + public void setPanel21(JPanel panel21) { + this.panel21 = panel21; + } + + public JPanel getPanel22() { + return panel22; + } + + public void setPanel22(JPanel panel22) { + this.panel22 = panel22; + } + + public JPanel getPanel23() { + return panel23; + } + + public void setPanel23(JPanel panel23) { + this.panel23 = panel23; + } + + public JPanel getPanel24() { + return panel24; + } + + public void setPanel24(JPanel panel24) { + this.panel24 = panel24; + } + + public JPanel getPanel25() { + return panel25; + } + + public void setPanel25(JPanel panel25) { + this.panel25 = panel25; + } + + public JPanel getPanel26() { + return panel26; + } + + public void setPanel26(JPanel panel26) { + this.panel26 = panel26; + } + + public JPanel getPanel27() { + return panel27; + } + + public void setPanel27(JPanel panel27) { + this.panel27 = panel27; + } + + public JPanel getPanel28() { + return panel28; + } + + public void setPanel28(JPanel panel28) { + this.panel28 = panel28; + } + + public JPanel getPanel29() { + return panel29; + } + + public void setPanel29(JPanel panel29) { + this.panel29 = panel29; + } + + public JPanel getPanel30() { + return panel30; + } + + public void setPanel30(JPanel panel30) { + this.panel30 = panel30; + } + + public JPanel getPanel31() { + return panel31; + } + + public void setPanel31(JPanel panel31) { + this.panel31 = panel31; + } + + public JPanel getPanel32() { + return panel32; + } + + public void setPanel32(JPanel panel32) { + this.panel32 = panel32; + } + + public JPanel getPanel33() { + return panel33; + } + + public void setPanel33(JPanel panel33) { + this.panel33 = panel33; + } + + public JPanel getPanel34() { + return panel34; + } + + public void setPanel34(JPanel panel34) { + this.panel34 = panel34; + } + + public JPanel getPanel35() { + return panel35; + } + + public void setPanel35(JPanel panel35) { + this.panel35 = panel35; + } + + public JPanel getPanel36() { + return panel36; + } + + public void setPanel36(JPanel panel36) { + this.panel36 = panel36; + } + + public int getxCords1() { + return xCords1; + } + + public void setxCords1(int xCords1) { + this.xCords1 = xCords1; + } + + public int getxCords2() { + return xCords2; + } + + public void setxCords2(int xCords2) { + this.xCords2 = xCords2; + } + + public int getxCords3() { + return xCords3; + } + + public void setxCords3(int xCords3) { + this.xCords3 = xCords3; + } + + public int getxCords4() { + return xCords4; + } + + public void setxCords4(int xCords4) { + this.xCords4 = xCords4; + } + + public int getxCords5() { + return xCords5; + } + + public void setxCords5(int xCords5) { + this.xCords5 = xCords5; + } + + public int getxCords6() { + return xCords6; + } + + public void setxCords6(int xCords6) { + this.xCords6 = xCords6; + } + + public int getyCords1() { + return yCords1; + } + + public void setyCords1(int yCords1) { + this.yCords1 = yCords1; + } + + public int getyCords2() { + return yCords2; + } + + public void setyCords2(int yCords2) { + this.yCords2 = yCords2; + } + + public int getyCords3() { + return yCords3; + } + + public void setyCords3(int yCords3) { + this.yCords3 = yCords3; + } + + public int getyCords4() { + return yCords4; + } + + public void setyCords4(int yCords4) { + this.yCords4 = yCords4; + } + + public int getyCords5() { + return yCords5; + } + + public void setyCords5(int yCords5) { + this.yCords5 = yCords5; + } + + public int getyCords6() { + return yCords6; + } + + public void setyCords6(int yCords6) { + this.yCords6 = yCords6; + } + public JPanel getPanel1() { return panel1; } From 803734fd1b3864235d60deb8253d17fa223e68c8 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:47:00 +0100 Subject: [PATCH 44/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20xCords1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index fef85cb..1ae4274 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -63,4 +63,9 @@ public class SnakeGameTest { assertTrue(snek.getBreiteP4() == breite ); } + public void xCords1Test() { + int Cords = 300; + assertTrue(snek.getxCords1() == Cords ); + } + } \ No newline at end of file From fb12d13a23f9e911e6ae516c5c01061f00ca029f Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:48:04 +0100 Subject: [PATCH 45/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20xCords2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 1ae4274..834b127 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -68,4 +68,9 @@ public class SnakeGameTest { assertTrue(snek.getxCords1() == Cords ); } + public void xCords2Test() { + int Cords = 400; + assertTrue(snek.getxCords2() == Cords ); + } + } \ No newline at end of file From 3416b77a12f9df94f87705cf9a8323a024e13a94 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:49:57 +0100 Subject: [PATCH 46/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20xCords3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 834b127..71bea6d 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -73,4 +73,9 @@ public class SnakeGameTest { assertTrue(snek.getxCords2() == Cords ); } + public void xCords3Test() { + int Cords = 500; + assertTrue(snek.getxCords3() == Cords ); + } + } \ No newline at end of file From 2a7f888a7e84549aafd26cc1b5e79f90878996a2 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:51:15 +0100 Subject: [PATCH 47/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20xCords4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 71bea6d..3480c88 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -78,4 +78,9 @@ public class SnakeGameTest { assertTrue(snek.getxCords3() == Cords ); } + public void xCords4Test() { + int Cords = 600; + assertTrue(snek.getxCords4() == Cords ); + } + } \ No newline at end of file From 72055f00ae2d62d50d5fb91ea448a79a6f89fa29 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:52:18 +0100 Subject: [PATCH 48/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20xCords5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 3480c88..2e65d24 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -83,4 +83,9 @@ public class SnakeGameTest { assertTrue(snek.getxCords4() == Cords ); } + public void xCords5Test() { + int Cords = 700; + assertTrue(snek.getxCords5() == Cords ); + } + } \ No newline at end of file From 4123f7cb99fa61b693bf506cb7befba6f6ede586 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:53:22 +0100 Subject: [PATCH 49/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20JUnitTest=20f?= =?UTF-8?q?=C3=BCr=20xCords6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gruppenprojekt/JavaGamelauncher/SnakeGameTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 2e65d24..8663f7f 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -88,4 +88,9 @@ public class SnakeGameTest { assertTrue(snek.getxCords5() == Cords ); } + public void xCords6Test() { + int Cords = 800; + assertTrue(snek.getxCords6() == Cords ); + } + } \ No newline at end of file From a9e51e422f227459892967818fde81345aa6d45d Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:55:28 +0100 Subject: [PATCH 50/54] refactoring:[SnakeGame Class]: hoeheP1 ausgelagert --- .../de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index b44d461..ec91bbf 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -103,7 +103,7 @@ public class SnakeGame extends JFrame { cP.setLayout(null); panel1 = new JPanel(); - panel1.setBounds(xCords1, yCords1, 100, 100); + panel1.setBounds(xCords1, yCords1, hoeheP1, 100); panel1.setVisible(true); panel1.setBackground(Color.BLACK); From 3edcd830b06dc8f4eafef48d85be6b704354b8b2 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:56:32 +0100 Subject: [PATCH 51/54] refactoring:[SnakeGame Class]: breiteP1 ausgelagert --- .../de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index ec91bbf..0b269a2 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -103,7 +103,7 @@ public class SnakeGame extends JFrame { cP.setLayout(null); panel1 = new JPanel(); - panel1.setBounds(xCords1, yCords1, hoeheP1, 100); + panel1.setBounds(xCords1, yCords1, hoeheP1, breiteP1); panel1.setVisible(true); panel1.setBackground(Color.BLACK); From a662abd00d7934bbc8f727b94940701fc5bdb756 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:57:32 +0100 Subject: [PATCH 52/54] refactoring:[SnakeGame Class]: hoeheP2 ausgelagert --- .../de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 0b269a2..30a9c37 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -180,7 +180,7 @@ public class SnakeGame extends JFrame { cP.add(panel11); panel12 = new JPanel(); - panel12.setBounds(xCords6, yCords2, 100, 100); + panel12.setBounds(xCords6, yCords2, hoeheP2, 100); panel12.setVisible(true); panel12.setBackground(Color.BLACK); From cf5cf8d792bc35e4f03c1d43e249a1f506c4d307 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 11:58:22 +0100 Subject: [PATCH 53/54] refactoring:[SnakeGame Class]: breiteP2 ausgelagert --- .../de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 30a9c37..89b968d 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java @@ -180,7 +180,7 @@ public class SnakeGame extends JFrame { cP.add(panel11); panel12 = new JPanel(); - panel12.setBounds(xCords6, yCords2, hoeheP2, 100); + panel12.setBounds(xCords6, yCords2, hoeheP2, breiteP2); panel12.setVisible(true); panel12.setBackground(Color.BLACK); From 64bbcd9d768eb891f6beb1001ff422a5e9b54e85 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Thu, 2 Feb 2023 12:02:01 +0100 Subject: [PATCH 54/54] =?UTF-8?q?[SnakeGameTest=20Class]:=20einf=C3=BCgen?= =?UTF-8?q?=20von=20@Test.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/GamelauncherMain.java | 4 ++-- .../JavaGamelauncher/SnakeGameTest.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java index f5aaf5c..c573970 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java @@ -109,8 +109,8 @@ public class GamelauncherMain extends JFrame {//class public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - //SnakeGame frameSnake = new SnakeGame(); - //frameSnake.setVisible(true); + SnakeGame frameSnake = new SnakeGame(); + frameSnake.setVisible(true); } }); diff --git a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java index 8663f7f..d2a25e7 100644 --- a/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java +++ b/JavaGamelauncher/src/test/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGameTest.java @@ -6,88 +6,106 @@ import org.junit.Test; public class SnakeGameTest { SnakeGame snek = new SnakeGame(); + @Test public void test() { assertTrue(true); } + @Test public void hoeheTest() { assertTrue(snek.hoehe == 600); } + @Test public void breiteTest() { assertTrue(snek.breite == 1200); } + @Test public void titelTest() { assertTrue(snek.titel == "Snake"); } + @Test public void hoehePanelTest() { int hoehe = 100; assertTrue(snek.getHoeheP1() == hoehe ); } + @Test public void breitePanelTest() { int breite = 100; assertTrue(snek.getBreiteP1() == breite ); } + @Test public void hoehePane2Test() { int hoehe = 100; assertTrue(snek.getHoeheP2() == hoehe ); } + @Test public void breitePane2Test() { int breite = 100; assertTrue(snek.getBreiteP2() == breite ); } + @Test public void hoehePane3Test() { int hoehe = 100; assertTrue(snek.getHoeheP3() == hoehe ); } + @Test public void breitePane3Test() { int breite = 100; assertTrue(snek.getBreiteP3() == breite ); } + @Test public void hoehePane4Test() { int hoehe = 100; assertTrue(snek.getHoeheP4() == hoehe ); } + @Test public void breitePane4Test() { int breite = 100; assertTrue(snek.getBreiteP4() == breite ); } + @Test public void xCords1Test() { int Cords = 300; assertTrue(snek.getxCords1() == Cords ); } + @Test public void xCords2Test() { int Cords = 400; assertTrue(snek.getxCords2() == Cords ); } + @Test public void xCords3Test() { int Cords = 500; assertTrue(snek.getxCords3() == Cords ); } + @Test public void xCords4Test() { int Cords = 600; assertTrue(snek.getxCords4() == Cords ); } + @Test public void xCords5Test() { int Cords = 700; assertTrue(snek.getxCords5() == Cords ); } + @Test public void xCords6Test() { int Cords = 800; assertTrue(snek.getxCords6() == Cords );