Hello! I am tying to make a top down 4 direction rpg style game and I am trying to come up with a way to make a certain enemy run away from the player in 4 directions. I assumed that I could tell the enemy sprite to compare it's location to the player and use that information to go the opposite direction.
Using the 8-direction behavior I have been able to successfully get two different results. While I have all for directions activated it seems that it only wants to slide left or right, or up and down. If i deactivate the events for up and down movement, the right and left will work correctly and vice versa. This lead me to believe that I was using the wrong approach. I have also tried using the bullet behavior with no avail. The farthest I have come Is this current .capx I have using 2 separate 8-direction behaviors for up and down, as well as left and right. This as you can see has yielded me results in which the enemy wants to move diagonally in 4 directions instead of up down left and right.
Any insight on a better approach to this problem would be greatly appreciated!
Here is the .capx
dropbox.com/s/tvrnsb2dovg3tks/enemy%20AI%20test.capx