Direction of Attack

Game Editor comments and discussion.

Direction of Attack

Postby bubblemasterx » Sun Feb 05, 2012 10:23 pm

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.
bubblemasterx
 
Posts: 3
Joined: Sun Feb 05, 2012 3:51 am
Score: 0 Give a positive score

Re: Direction of Attack

Postby CoFFiN6 » Sun Feb 05, 2012 11:05 pm

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.
Don't run faster then the dragon, run faster than your friends :P
User avatar
CoFFiN6
 
Posts: 49
Joined: Sun Sep 11, 2011 8:17 pm
Location: South Africa
Score: 4 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron