Ich habe nen kleines Problem, der compiler meint immer das meine Methode keine sei.
Application Terminated (TypeError): var$0.$moveToolTo is not a function
Seht ihr hier einen offensichtlichen Fehler?
Application Terminated (TypeError): var$0.$moveToolTo is not a function
Seht ihr hier einen offensichtlichen Fehler?
Java:
public boolean moveToolTo(Controller p, int x, int y) {
if (isValid(height, width, x, y)) {
System.out.println("test");
while (xpasst == false && ypasst == false) {
int xA = p.getX();
int yA = p.getY();
if (xA == x) {
boolean xpasst = true;
} else if (xA > x) {
p.move(Controller.LEFT);
} else if (xA < x) {
p.move(Controller.RIGHT);
}
if (yA == y) {
boolean ypasst = true;
} else if (yA > y) {
p.move(Controller.UP);
} else if (yA < y) {
p.move(Controller.DOWN);
}
}
return true;
} else
return false;
}