Idea
Posted: Wed Apr 25, 2012 3:13 am
I just had an idea. That idea is, (after reading someones post about crouching btw), making a way to manage multiple animations, or rather having "mechanics" to actors.
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
and you have multiple animStyles. when DOWN is pressed, crouch is active, so:
add a #define crouch 0 to make it look like animStyle[crouch]=1;
then to determine the movement style:
See what I mean? This way you could have many animations for both the player and the AI with little trouble
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