I need that line in my code, but then it says Cannot find symbol - varable direction .
What shall i do?
Shall i create a variable "direction" and say getX() and getY() ?
If you're trying to check the direction that your actor is facing, use getRotation() and compare it to various angles, not to strings. Eg instead of
if (direction.equals("west")) {
Use
if (getRotation() == 180) {