Hello guys,
I'm part of a team of students who would like to do a tower defense game as their project and we would really much appreciate any advice regarding our problem.
Now, I've noticed that in isometric tower defense games, the little soldiers usually have 8 different animations for 8 different directions. So, when the soldier is walking from south to north, there's an walking-animation that shows him from behind; another one that shows him from the front when he's going from north to south and so on.
In the attached example project I have set up 8 animations:
[attachment=2:t6tdp5st][/attachment:t6tdp5st]
Since I can not call every single animation directly with one single event (because the "Set animation to..."-event needs a string as input which I can not directly get from the "Enemy.Pathfinding.MovingAngle"-call (gives only numbers)) I have used an array to assign each animation an int-variable.
[attachment=1:t6tdp5st][/attachment:t6tdp5st]
And then there's that crazy mad action (with the red arrow next to it) that sets the correct animation depending on the moving angle. I partly stole that action from another thread and it works now, but our game is already really heavy and with 30 units each calling that action every tick I'm afraid that the game will go into cardiac arrest. So my question is:
Is there a better way? One that is perhaps less hard on the processing power?
Thank you very much for any advice. This forum has already helped me a lot.