Understanding the direction of movement of an actor
I'm working on a new game and we're trying to work with an isometric view. I already solved (apparently) the overlapping issue and it looks like the actors move in a tridimensional space.
Our animator is working on 5 walk cycles for each character, one for every direction (8 in total: 0,45,90,135,180,225,270,315. Of course some of these will just be flipped).
While it's pretty clear how to switch animations for my character, as the player controls it, I'm not sure how to detect the angle (and therefore the animation I need) for the enemies. The enemies basically moves towards the character contantly, with this behavior here:
I guess I need to use the vectorToangle function somehow, but I can't understand how to detect if the enemy is going down, up, down-right etc...
I think it should be easy, but for some reason I can't figure it out. Hope someone can help me! Thank you!
Wonder Maru: casual games for casual people. www.wondermaru.com