Java 2D enemy following issue

I am writing a paintball Java 2D game code, but I am stuck.
Problem is: the enemy who should chase me(while not running into walls, but bypass them), and stop in a approx. 50px distance, which in the top left corner works fine, but nowhere else.

My code can be found here: https://github.com/akosfarkas/new29PC.git

What can cause the problem? Please help!