This method would require precise names for animations, however. I haven't put it to the test, but what if you create an array, like this
- Code: Select all
int animStyle[5];
and you have multiple animStyles. when DOWN is pressed, crouch is active, so:
- Code: Select all
animStyle[0]=1;
animStyle[1]=0...etc;
add a #define crouch 0 to make it look like animStyle[crouch]=1;
then to determine the movement style:
- Code: Select all
switch(dir)
{
case 0: //right
if(animStyle[0])
{
... crouch right
}
etc...
break;
}
See what I mean? This way you could have many animations for both the player and the AI with little trouble