I wanted to add an enemy-chase function in my game, and found this code:
angle = direction(x, y, yourhero .x, yourhero .y);
directional_velocity = 10;
And this works perfectly
However, I have tried to find a way to change the enemy's animation depending on which way he is chasing my actor. Say, if he is chasing you to the left, it's playing the "running left" animation, but when your player has for example jumped over the enemy and he start chasing you to the right instead, the "running right" animation should display instead.
I haven't found a solution to this, and was hoping anyone here could help me out?