Thanks, but where do i put the while loop then? I had it with else but it did not work, so i changed it to how it looks now... The thing is i cant use if, because the direction is set in an event before, and it could be that the walker is on the top left corner, so he has to change directions till he is not going to the left and not going to the right... I just dont get it how this can be an infinite loop, maybe i am doing something in the wrong order?
Kind regards