A.I animations

Non-platform specific questions.

A.I animations

Postby LowDefFTW » Sun Mar 04, 2012 3:26 pm

Im making a fighter type game but I cant figure out how to change the animation when the enemy is moving, I tried using this code

if (xprevious<x)ChangeAnimation("Event Actor", "right", FORWARD);
if (xprevious>x)ChangeAnimation("Event Actor", "left", FORWARD);

But the animation started again before finishing, I also would like to know if theres any way to use "and","or" operators.
LowDefFTW
 
Posts: 5
Joined: Sun Mar 04, 2012 3:23 am
Score: 0 Give a positive score

Re: A.I animations

Postby jimmynewguy » Sun Mar 04, 2012 3:50 pm

For and use && and for or use ||
Code: Select all
if(var1 == 2 && var2 == 1)
{
// code
}
if(var 1 == 2 || var2 == 1)
{
// code
}

And for the animation, change "FORWARD" to "NO_CHANGE" so the animation will keep going instead of starting again.
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: A.I animations

Postby LowDefFTW » Sun Mar 04, 2012 4:08 pm

thanks a lot!! :D
LowDefFTW
 
Posts: 5
Joined: Sun Mar 04, 2012 3:23 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest