Hello Everyone.I'm trying to set an enemy behavior. My enemy "Wizard" is normally roaming between 2 blocks and while he's going right he looks to right and while he's going left he looks to left. And if I get close to wizard (300 pixel) , It stops and throw me a fireball every 2 seconds.Everything works fine.The only problem I have is no matter what I tried I couldn't manage this situation:
1:When I'm close to wizard, Wizard should look towards me
2:When I'm getting far away, wizard should continue to move as if I never got close.