Whatever method you use to implement the running away part (i.e. simple X/Y movements away equated to the chasing actor's X/Y movements or a vectorToAngle() within a move constrained to the player's speed, etc.), you will probably want to constrain the running away to only occur when they are close enough to each other (i.e. use the magnitude() function and only run away when they are close).
Comments