Page 1 of 1

Direction of Attack

PostPosted: Sun Feb 05, 2012 10:23 pm
by bubblemasterx
Hello community.
So, I'm working on a mini-platformer-type game, and I'm using the 'z' button to have my character attack enemies. The problem I'm having is, I don't know how to make the direction the character is attacking the same as the direction he's facing before he attacks, and then revert back to that same direction. Any scripting I need to use? Thanks in advance.
P.S. I'm kinda new, so a less complicated/more detailed solution would be greatly appreciated.

Re: Direction of Attack

PostPosted: Sun Feb 05, 2012 11:05 pm
by CoFFiN6
Hey! I'm also kinda new here. But I will say what I would have done in this situation but don't count on it being correct lol

I would firstly say you should learn how to use the "animindex" function. As I understand it it is the current animation of the actor. Like if my actor had 3 animations the animindex of them would be 0,1,2 .(As it starts at 0) .

Then what I would do is in your players Draw actor I would say something like
Code: Select all
if(animindex==0){ ~code to show Right fight~};
If(animindex==1){ ~code to show Left fight~};


Hope I'm correct here. If it doesn't work then I guess I will also learn something lol.