Hello,
I'm programming a game. Until today, it worked very well but suddenly it doesn't.
I'm using a method for detecting balks (see code down) but now my little character is convinced that there are balks everywhere around him, whether there is a free field or not. I have no idea where this is suddenly coming from, I changed nothing in this code piece but anyway it stopped working.
This is an example code piece, there are three more (left, up and down):
Is there anybody who could help me?
public boolean balkRight() {
int x = getX();
int y = getY();
move(1);
if (isTouching(tree.class) || isTouching(explodingBalk.class)) {
move(-1);
return true;
}
else {
move(-1);
return false;
}
}