geister ein bisschen verlangsamt

master
Lenz Wiechers 2020-06-06 17:02:20 +02:00
parent b0ff5c7c62
commit 565092908a
2 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -60,22 +60,22 @@ public class Ghost extends Picture { // Die
public int getPos(char coordinate, long dt) { // Hier kommt die zuvor erwähnte delta time ins Spiel
if (coordinate == 'x') { // Auslesen der 'x' - Koordinate:
if (left && dt != 0 && (Game.frames % 3) == 0) {
if (left && dt != 0 && Game.frames % 4 == 0) {
xPos -= 1;
} else if (right && dt != 0 && (Game.frames % 3) == 0) {
} else if (right && dt != 0 && Game.frames % 4 == 0) {
xPos += 1;
}
return (int) xPos;
} else if (coordinate == 'y') { // Auslesen der 'y' - Koordinate:
if (down && dt != 0 && (Game.frames % 3) == 0) {
if (down && dt != 0 && Game.frames % 4 == 0) {
yPos += 1;
} else if (up && dt != 0 && (Game.frames % 3) == 0) {
} else if (up && dt != 0 && Game.frames % 4 == 0) {
yPos -= 1;