From abc520f2bc4f9f89ecc6f5f6793dbcfe416b55b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 7 Jun 2020 21:08:10 +0200 Subject: [PATCH] Portale --- assets/Maps/Clusters.txt | 4 ++-- assets/Maps/Complexes.txt | 4 ++-- assets/Maps/OriginalMitPortale.txt | 30 +++++++++++++++++++++++++ bin/.gitignore | 11 +--------- bin/Game.class | Bin 9512 -> 10121 bytes bin/Map.class | Bin 2735 -> 2906 bytes src/Game.java | 34 ++++++++++++++++++++++++++--- src/Map.java | 13 ++++++++--- src/MapMenu.java | 18 ++++++++++----- src/Portal.java | 20 +++++++++++++++++ 10 files changed, 108 insertions(+), 26 deletions(-) create mode 100644 assets/Maps/OriginalMitPortale.txt create mode 100644 src/Portal.java diff --git a/assets/Maps/Clusters.txt b/assets/Maps/Clusters.txt index 1f80486..cf4344c 100644 --- a/assets/Maps/Clusters.txt +++ b/assets/Maps/Clusters.txt @@ -21,11 +21,11 @@ ### ## ## ## ## ## ### ,,# ## ## ## ## ## ## ## #,, ### ## ## ## ## ## ## ## ### -# ## P ## # +# ## ## # ### ## ##### ## ##### ## ### ### ## ##### ## ##### ## ### # ## ## ## # # #### ## ######## ## #### # #.#### ## ######## ## ####.# -# ## ## # +# ## P ## # ############################ diff --git a/assets/Maps/Complexes.txt b/assets/Maps/Complexes.txt index 097036b..18b89f4 100644 --- a/assets/Maps/Complexes.txt +++ b/assets/Maps/Complexes.txt @@ -1,7 +1,7 @@ ################################## # # # # ## ## ################# ## # # -# # ## ## ## ## # # +# # ## ## R# ## # # # ## ################# ## ## # # # ## ## ## ## # # # # ## ##.##############.## ## # # @@ -26,7 +26,7 @@ # ### ## #P############## ## ### # # ### ## # # ## ### # # ## # ############ # ## # -# ### ## # # ## ### # +# ### #L # # ## ### # # ### ## ###.########.### ## ### # # # ################################## \ No newline at end of file diff --git a/assets/Maps/OriginalMitPortale.txt b/assets/Maps/OriginalMitPortale.txt new file mode 100644 index 0000000..a99c3c3 --- /dev/null +++ b/assets/Maps/OriginalMitPortale.txt @@ -0,0 +1,30 @@ +############################ +# ## # +#.#### ##### ## ##### ####.# +# #### ##### ## ##### #### # +# # +# #### ## ######## ## #### # +# #### ## ######## ## #### # +# ## ## ## # +###### ##### ## ##### ###### +,,,,,# ##### ## ##### #,,,,, +,,,,,# ## ## #,,,,, +,,,,,# ## ## ## ## ## #,,,,, +###### ## ## ## ## ## ###### +#L ,,0123,, R# +###### ## ## ## ## ## ###### +,,,,,# ## ## ## ## ## #,,,,, +,,,,,# ## ## #,,,,, +,,,,,# ## ######## ## #,,,,, +###### ## ######## ## ###### +# ## # +# #### ##### ## ##### #### # +# #### ##### ## ##### #### # +#. ## P ## .# +### ## ## ######## ## ## ### +### ## ## ######## ## ## ### +# ## ## ## # +# ########## ## ########## # +# ########## ## ########## # +# # +############################ diff --git a/bin/.gitignore b/bin/.gitignore index 997d383..67fc30e 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,12 +1,3 @@ -/BigPoint.class -/Brick.class -/Game.class -/Ghost.class -/Lives.class -/Main.class -/Map.class /MapMenu$1.class /MapMenu.class -/Picture.class -/Player.class -/Point.class +/Portal.class diff --git a/bin/Game.class b/bin/Game.class index e64bea42d2bee6f49181aae2c9f76a4e56442831..2d0ff96518b582b8543c9a74e4ed2662fd28bf76 100644 GIT binary patch delta 4897 zcma)A33L=y7JWBW)m2?x-PO?DEFnSwN0P`I5m1yxAqpaEgg_K&(oGU3n@Nj_qKyiS zC@NBlBp@K-1Xm0k_an6F{la- zkUuLsg>71-y0oHrxDE}v3Ma^Cdn&CQFqs7r7Kel723*t|q*e*2tilO5y{W>(5yqny zz`t~Ulq932h#;I~F;{*mZpPzUnr1avXbl{Rrip>SESPN%8pW*`HnftT1o1E*W-wN4YxFwloqvq4SLKnyk8Ko0c;>BS|LHIXZ; zDr*V^Ltg{^(4S*u<;j&b>^SSfaoN*_#XtjtEI579vkdA^J|}CRZD0t7vi7`iusY0v zV3vT-F>o&VK(08PUs@in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%ndnt?j9x`2pRUo$Bdh3%euV=o zIJ$zqRrIgoF%L!Ap+8TnHyc(y;(wIF`oSGxi$Qa_KnMLe**t@bJ=MOd=E~RPzYp8@D{`+AE0Gkh1eQu zTLW>P5K?j*j4j-sB04mu4M9F%fk~KhzS3tP#1GNP}r5k`K zSr1gY21xNf(C0qT{s5?K0}v(afy&kZDc%P<>jRndh%TZ|-NxK#pehNqR`Eh&5igdU zTf&PAi1`Mwc|5p?UCQ9)4F<0!7EszzaycYwBlVx&id+_AJDHn*Enr)my`fs?HMY*) z6cG+R=2x&;o$hT-_Pwrz6$H=wtKd)APdfL!U?gS2SIUj__ zZobTJ{g|u&6CA?l)L6!0{K)-v4Ugg%9Km&3+(M6tpjXuKdlAD?(Sc*)IF5@^el(}i zCobR#aS12HNBnkthJNuCPKxg^Ab#ct?ix;s-!LR@BB6ybtnJ2WZ7B zXSB!gtk#dS+9}duzMqDrrmo$eonY!(H3M&P$^|;bADs02n0uG_9dA<>B2Eq7!Mi+t xk9i-!mcP+Xr-qKCXt;qRH}Lp>e=TVpSA_N_%Kzbf3Y|v$xl%*=K8-be@GlftSkC|e diff --git a/src/Game.java b/src/Game.java index 71ebb39..dc7ef47 100644 --- a/src/Game.java +++ b/src/Game.java @@ -47,7 +47,7 @@ public class Game { int[] HCost = new int[4]; public Game(String selectedMap) { // Erstellen des Konstruktors (Was soll passieren, sobald dieses Klasse - // aufgerufen wird?) + // aufgerufen wird?) frame = new JFrame(); // Fenster ImageIcon img = new ImageIcon("assets/Pacman_Right.png"); @@ -133,10 +133,16 @@ public class Game { } } } + System.out.println(Map.Left + " " + Map.Right); + if (Map.Left != null && Map.Right != null) { + panel.add(Map.Left); + panel.add(Map.Right); + Map.Left.setBounds(Map.Left.xPos, Map.Left.yPos, 20, 20); + Map.Right.setBounds(Map.Right.xPos, Map.Right.yPos, 20, 20); + } - delay(30); lastT = System.nanoTime(); // delta time - + delay(1000); frame.setVisible(true); // ----------------------------------------------------------------------------------------------------------------------------------------------------- @@ -335,6 +341,28 @@ public class Game { } } } + if (Map.Left != null) { + if (player.getPos('x', 0) < Map.Left.xPos + 20 && player.getPos('x', 0) > Map.Left.xPos - 20 + && player.getPos('y', 0) < Map.Left.yPos + 20 && player.getPos('y', 0) > Map.Left.yPos - 20) { + + if (Map.Right != null) { + player.xPos = Map.Right.xPos - 20; + player.yPos = Map.Right.yPos; + + } + } + } + if (Map.Right != null) { + if (player.getPos('x', 0) < Map.Right.xPos + 20 && player.getPos('x', 0) > Map.Right.xPos - 20 + && player.getPos('y', 0) < Map.Right.yPos + 20 && player.getPos('y', 0) > Map.Right.yPos - 20) { + + if (Map.Left != null) { + player.xPos = Map.Left.xPos + 20; + player.yPos = Map.Left.yPos; + + } + } + } for (int i = 0; i < 35; i++) { for (int j = 0; j < 35; j++) { if (Map.bigpoints[j][i] != null) { diff --git a/src/Map.java b/src/Map.java index b9ee715..96710fa 100644 --- a/src/Map.java +++ b/src/Map.java @@ -9,6 +9,9 @@ public class Map { public static Brick bricks[][] = new Brick[35][35]; // Zweidimensionales Array für alle Bricks public static Point points[][] = new Point[35][35]; public static BigPoint bigpoints[][] = new BigPoint[35][35]; + + public static Portal Left; + public static Portal Right; // Zweidimensionale Arrays siehe // https://de.wikipedia.org/wiki/Feld_(Datentyp)#Mehrdimensional_/_in-sich-mehrdimensional @@ -24,7 +27,7 @@ public class Map { public static int pac_posX; public static int pac_posY; - + String selectedMap; String line; // String in dem eingelsene Zeilen der Datei gespeichert werden @@ -33,7 +36,7 @@ public class Map { this.ghosts = ghosts; this.player = player; - + this.selectedMap = selectedMap; } @@ -42,7 +45,7 @@ public class Map { try { reader = new BufferedReader(new FileReader("assets/Maps/" + selectedMap)); // Einlesen der .txt Datei - + System.out.println(selectedMap); for (int i = 0; i < 35; i++) { // für die ersten 35 Zeilen der Datei: @@ -83,6 +86,10 @@ public class Map { } else if (line.charAt(j) == '.') { bigpoints[i][j] = new BigPoint(10 + 20 * j, 10 + 20 * i); + } else if (line.charAt(j) == 'L') { + Left = new Portal(10 + 20 * j, 10 + 20 * i); + } else if (line.charAt(j) == 'R') { + Right = new Portal(10 + 20 * j, 10 + 20 * i); } } catch (Exception e) { diff --git a/src/MapMenu.java b/src/MapMenu.java index 84b5650..6712d7c 100644 --- a/src/MapMenu.java +++ b/src/MapMenu.java @@ -12,13 +12,18 @@ import javax.swing.JTextField; public class MapMenu extends JFrame { + /** + * + */ + private static final long serialVersionUID = 2863784680171430142L; + public boolean rdy; JButton button; JPanel panel; - JComboBox bob; + JComboBox bob; String[] maps; @@ -45,7 +50,7 @@ public class MapMenu extends JFrame { } this.setVisible(true); - this.setBounds(100, 100, 300, 200); + this.setBounds(750, 300, 300, 200); this.setResizable(false); // Man kann die Größe des Frame nicht verändern panel = new JPanel(); // Panel auf dem visuellen Elemente angezeigt werden @@ -54,9 +59,9 @@ public class MapMenu extends JFrame { this.setContentPane(panel); this.getContentPane().setLayout(null); - button = new JButton("Lauch dat shit"); + button = new JButton("Launch"); panel.add(button); - button.setBounds(20, 100, 150, 30); + button.setBounds(70, 50, 120, 30); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { try { @@ -67,9 +72,10 @@ public class MapMenu extends JFrame { } }); - bob = new JComboBox(maps); + bob = new JComboBox(maps); + bob.setSelectedIndex(4); panel.add(bob); - bob.setBounds(30, 30, 180, 30); + bob.setBounds(70, 10, 120, 30); } diff --git a/src/Portal.java b/src/Portal.java new file mode 100644 index 0000000..59995a9 --- /dev/null +++ b/src/Portal.java @@ -0,0 +1,20 @@ +// Diese Klasse stellt die einzelnen Bicks (Wände) auf der Map dar. + +public class Portal extends Picture { + + + + private static final long serialVersionUID = -8813034369041822237L; + public int xPos; + public int yPos; + + public Portal(int newXPos, int newYPos) { + + super("portal"); + + xPos = newXPos; + yPos = newYPos; + + } + +}