I wouldn't do it this way...
calculate the distance between the two objects
sqrt(pow(player.x-my.x,2)+pow(player.y-my.y,2))
and let him look at the player.
if the distance is bigger than (for example) 20 make him move until the distance is smaller than for example 10 make him stop.
you will only have a problem with obstacles.
edit:
tell me if you need a code for this.
Last edited by Fab4; 09/06/09 18:29.