From d6c82f4e4c29f8da3bf5e3721edcdce45a8f601a Mon Sep 17 00:00:00 2001 From: Lenz Date: Thu, 21 May 2020 16:39:25 +0200 Subject: [PATCH] =?UTF-8?q?nur=20ne=20k=C3=83leineAenderung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Map.txt | 2 +- bin/Game.class | Bin 4774 -> 4499 bytes bin/Ghost.class | Bin 1297 -> 1453 bytes src/Game.java | 7 ++----- src/Ghost.java | 7 ++++--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/assets/Map.txt b/assets/Map.txt index 7851a67..89bbe50 100644 --- a/assets/Map.txt +++ b/assets/Map.txt @@ -4,7 +4,7 @@ # # # ## ### ##### # # # ########## ### ########## # # # ################# ##### ##### -# # # # #### #### +# # # # # #### #### # # # # #################### ###### # # # # # P####### ###### # # # # # ################## ###### diff --git a/bin/Game.class b/bin/Game.class index 9cea366349fbc1bfd1f4aaecd2da00b47d3b01af..d9d8a4df2bf9b35f39498ac94969571c9b2f5019 100644 GIT binary patch delta 1186 zcmaize@vBS6vsdBectEZ%jE@0B^wkuTpN&^8*7bV{aChzPMejh)mnLxE8s2{0wf{U z&B9+Ln7xHXX<_BvRFof=i$P%~iqS7CD@)3XewnWFzZNE)_g?z(PiuSkKHuk@@Ao|C zJkL2hudwI%MlTEu0oQQ0+xN1*(#O^8w%9|bfwwGBS3JL}w$30qXVH?Nzadall)J#k zKDs@0*`4l7=Js%}fv38rB2*U)B~eJ!qK}w?84Rotp>elQjQcHKWxzh?P7l9k@w(&J zH5Fy$b&leI#T$;rwW`|LzG-nN9-y@9fsi9UY;h!h%5r~j`Aroy4(X`HTg;Fs!HW7o zt(F2PY9Gai!MhgkIdokbkc&9ZOn|8xQD{ zy_HF2E*HPrH&_?jXOj=ur>)uPlU5Hq^P&`}eEDA+V^@s5c5+Iq(QCJ-WaRWa*0hEm zTGHM5={i43Ta36-_0b#Qh~tkkXpj9Lc`!nAf;?nrr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nEro%=-LAa!Zv$(rC(Y zdF7x)>1y12>5mn-e>rgWLg0hTfpZrEA6^bzxDYtU|1s|ioMDtJg?P7*<#nFl^XWNo LsI%vS>U#1Y@))iC diff --git a/src/Game.java b/src/Game.java index 9b3a999..2fdf780 100644 --- a/src/Game.java +++ b/src/Game.java @@ -117,6 +117,7 @@ public class Game { if (Map.bricks[((ghosts[i].getPos('y', 0) - 10) / 20) + 1][(ghosts[i].getPos('x', 0) - 10) / 20] == null) { ghost_down_possible[i] = true; + } if (Map.bricks[(ghosts[i].getPos('y', 0) - 10) / 20][((ghosts[i].getPos('x', 0) - 10) / 20) - 1] == null) { @@ -126,11 +127,6 @@ public class Game { + 1] == null) { ghost_right_possible[i] = true; } - - System.out.println("up: " + ghost_up_possible[i] + " | down: " + ghost_down_possible[i] + " | left: " - + ghost_left_possible[i] + " | right: " + ghost_right_possible[i]); - - // System.out.println((ghosts[i].getPos('y', 0) - 10) / 20); ghost_up_possible[i] = false; ghost_down_possible[i] = false; @@ -138,6 +134,7 @@ public class Game { ghost_right_possible[i] = false; } + System.out.println(ghosts[0].getHCost(player)); // Kollision von Pac-Man mit Bricks: for (int i = 0; i < 35; i++) { // für jeden Brick diff --git a/src/Ghost.java b/src/Ghost.java index 8d2b66b..0dad550 100644 --- a/src/Ghost.java +++ b/src/Ghost.java @@ -8,8 +8,6 @@ public class Ghost extends Picture { // Die private int yPos; private int HCost; - private int GCost; - private int FCost; public Ghost(int index) { @@ -59,10 +57,13 @@ public class Ghost extends Picture { // Die } - public int getHCost() { + public int getHCost(Player player) { + HCost = (int) Math.sqrt(Math.pow(xPos - player.getPos('x', 0), 2) + Math.pow(yPos - player.getPos('y', 0), 2)); return HCost; } + + }