geister ein bisschen verlangsamt
parent
b0ff5c7c62
commit
565092908a
BIN
bin/Ghost.class
BIN
bin/Ghost.class
Binary file not shown.
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue