Change direction when close to shadow