diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..1d69790 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + Pac-Man + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/README.txt b/README.txt index 397865a..e69de29 100644 --- a/README.txt +++ b/README.txt @@ -1,3 +0,0 @@ -A simple Pac-Man clone. -So far. -About to add Path finding for the Ghosts and an A.I. that controls Pac-Man. \ No newline at end of file diff --git a/assets/Map.txt b/assets/Map.txt index 38f4b8a..6fdea19 100644 --- a/assets/Map.txt +++ b/assets/Map.txt @@ -1,35 +1,17 @@ -################################## -# # 0 # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # ############################ # -# # P 123 # -################################## -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -## \ No newline at end of file +###############################0### +# # ## +# # ############### ############### +# # # ## ### ##### +# # # ########## ### ##### ##### +# # # ################# ##### ##### +# # # # #### ##### +# # # # #################### ###### +# # # # # P####### ###### +# # # # # ################## ###### +# # # # # # ######## ###### +# # # # # # ####### ## ## +# # # # # # ############# ###### ## +# # # # # ############# ## ## +# # # # ##################### ## ## +# # #################### ## +############################123#### \ No newline at end of file diff --git a/bin/Brick.class b/bin/Brick.class index 98f1c69..50ef0ed 100644 Binary files a/bin/Brick.class and b/bin/Brick.class differ diff --git a/bin/Game.class b/bin/Game.class index 70373b0..9013845 100644 Binary files a/bin/Game.class and b/bin/Game.class differ diff --git a/bin/Ghost.class b/bin/Ghost.class index bc339ca..8a1f87d 100644 Binary files a/bin/Ghost.class and b/bin/Ghost.class differ diff --git a/bin/Main.class b/bin/Main.class index 499b059..1a83356 100644 Binary files a/bin/Main.class and b/bin/Main.class differ diff --git a/bin/Map.class b/bin/Map.class index fb0edde..bba0248 100644 Binary files a/bin/Map.class and b/bin/Map.class differ diff --git a/bin/Picture.class b/bin/Picture.class index 3737254..f720bca 100644 Binary files a/bin/Picture.class and b/bin/Picture.class differ diff --git a/bin/Player.class b/bin/Player.class index 702cafc..b5fa448 100644 Binary files a/bin/Player.class and b/bin/Player.class differ diff --git a/src/Brick.class b/src/Brick.class deleted file mode 100644 index 28bba17..0000000 Binary files a/src/Brick.class and /dev/null differ diff --git a/src/Game.class b/src/Game.class deleted file mode 100644 index d04c8a9..0000000 Binary files a/src/Game.class and /dev/null differ diff --git a/src/Ghost.class b/src/Ghost.class deleted file mode 100644 index 9654b17..0000000 Binary files a/src/Ghost.class and /dev/null differ diff --git a/src/Ghost.java b/src/Ghost.java index 6504434..69b0050 100644 --- a/src/Ghost.java +++ b/src/Ghost.java @@ -11,7 +11,7 @@ public class Ghost extends Picture { // Die super("Pinky"); // Aufrufen der übergeordneten Klasse - //xPos = 150 + 40 * index; + // xPos = 150 + 40 * index; if (index == 0) { this.changeSauce("Blinky"); @@ -35,7 +35,7 @@ public class Ghost extends Picture { // Die public void setPos(char coordinate, int newPos) { if (coordinate == 'x') { xPos = newPos; - } else if(coordinate == 'y') { + } else if (coordinate == 'y') { yPos = newPos; } } diff --git a/src/Main.class b/src/Main.class deleted file mode 100644 index ca256d9..0000000 Binary files a/src/Main.class and /dev/null differ diff --git a/src/Main.java b/src/Main.java index e8fde2c..cc91081 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,13 +1,11 @@ - -// Programmiert von Lenz Wiechers im Jahre 2020 - -/// Hauptdatei +// Hauptdatei // In dieser Datei wird das Spiel erstellt // Muss ausgeführt werden zum Starten public class Main { @SuppressWarnings("unused") // Die "unused" - Warnungen werden in dieser Datei nicht mehr angezeigt + public static void main(String[] args) { System.setProperty("sun.java2d.opengl", "true"); diff --git a/src/Map.class b/src/Map.class deleted file mode 100644 index c7b9160..0000000 Binary files a/src/Map.class and /dev/null differ diff --git a/src/Map.java b/src/Map.java index f962dae..4d07946 100644 --- a/src/Map.java +++ b/src/Map.java @@ -11,25 +11,24 @@ public class Map { // https://de.wikipedia.org/wiki/Feld_(Datentyp)#Mehrdimensional_/_in-sich-mehrdimensional BufferedReader reader; // reader zum Einlesen der Text Datei - + Player player; Ghost ghosts[]; String line; // String in dem eingelsene Zeilen der Datei gespeichert werden public Map(Player player, Ghost ghosts[]) { // Erstellen des Konstruktors - + this.ghosts = ghosts; this.player = player; } - - public void mapping(){ + + public void mapping() { try { - reader = new BufferedReader(new FileReader("assets/map.txt")); // Einlesen der .txt Datei - + for (int i = 0; i < 35; i++) { // für die ersten 35 Zeilen der Datei: String line = reader.readLine(); // Einlesen der jeweiligen Zeile for (int j = 0; j < 35; j++) { // für die ersten 35 Zeichen der jeweiligen Zeile @@ -52,9 +51,9 @@ public class Map { } else if (line.charAt(j) == '3') { ghosts[3].setPos('x', 10 + 20 * j); ghosts[3].setPos('y', 10 + 20 * i); - } + } } catch (Exception e) { - + } } } diff --git a/src/Picture.class b/src/Picture.class deleted file mode 100644 index b6bc609..0000000 Binary files a/src/Picture.class and /dev/null differ diff --git a/src/Picture.java b/src/Picture.java index 5569808..3506e27 100644 --- a/src/Picture.java +++ b/src/Picture.java @@ -7,7 +7,7 @@ import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JOptionPane; -// Diese Klasse ist die Grundlagee zum Render von Elementen auf dem Frame, anhand der Javax Swing Bibliothek +// Diese Klasse ist die Grundlage zum Rendern von Elementen auf dem Frame, anhand der Javax Swing Bibliothek public class Picture extends JLabel { // Die übergeordnete Klasse ist JLabel diff --git a/src/Player.class b/src/Player.class deleted file mode 100644 index e333f5a..0000000 Binary files a/src/Player.class and /dev/null differ diff --git a/src/Player.java b/src/Player.java index 857f346..6b0879f 100644 --- a/src/Player.java +++ b/src/Player.java @@ -243,4 +243,4 @@ public class Player extends Picture implements KeyListener { // extends Picture } -} +} \ No newline at end of file