H-Cost debug

master
leventius imperatus 2020-06-07 14:36:03 +02:00
parent b5b8cda739
commit 484fd6f84e
14 changed files with 6 additions and 5 deletions

0
assets/Highscores.txt Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -133,10 +133,11 @@ public class Game {
}
}
}
frame.setVisible(true);
delay(30);
lastT = System.nanoTime(); // delta time
frame.setVisible(true);
while (true) { // Hauptschleife
frames++;
if (ghosts[0].feared == true) {
@ -218,7 +219,7 @@ public class Game {
minn = HCost[j];
}
}
System.out.println(HCost[0]+ " "+HCost[1]+ " "+ HCost[2] + " "+HCost[3] );
for (int j = 0; j < 4; j++) {
if (HCost[j] == minn) {
if (j == 0) {

View File

@ -58,7 +58,7 @@ public class Ghost extends Picture { // Die
.sqrt(Math.pow((((xPos - 10) / 20) + mod_x) - ((player.getPos('x', 0) - 10 + 80) / 20), 2)
+ Math.pow((((yPos - 10) / 20) + mod_y) - ((player.getPos('y', 0) - 10) / 20), 2));
} else if (type == 2) {
HCost = (int) Math.sqrt(Math.pow((((xPos - 10) / 20) + mod_x) - ((300 - 10 + 80) / 20), 2)
HCost = (int) Math.sqrt(Math.pow((((xPos - 10) / 20) + mod_x) - ((250 - 10 + 80) / 20), 2)
+ Math.pow((((yPos - 10) / 20) + mod_y) - ((100 - 10) / 20), 2));
} else if (type == 3) {
HCost = (int) Math.sqrt(Math.pow((((xPos - 10) / 20) + mod_x) - ((player.getPos('x', 0) - 10) / 20), 2)