run animation

Talk about making games.

run animation

Postby Behdadsoft » Thu Jun 07, 2012 11:44 am

Hi.

I want run Full animation when press A key, for this work I used this script :
Code: Select all

char *key = GetKeyState();
int uper=key[KEY_a];
switch(uper)
{
case 1 :
{
if (Down==1)
{
   Down=0;
   ChangeAnimation("ShangTsung", "Shang-Uper1", NO_CHANGE);
 
}
}
break;
}


But the animation is not fully implemented.But when I hold down the key animation is fully implemented, While I like the animation by pressing once fully implemented.

Please Guide ME.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: run animation

Postby skydereign » Thu Jun 07, 2012 3:34 pm

What do you mean it is not fully implemented? If the animation doesn't finish because the animation changes to something else, then that is because you changed the animation in some other event. To prevent that, you have to create a variable to lock it in some way. I suggest using the state method when you come into conditions like this, as it locks it by default. But, to implement a variable to lock, create one, and set it to 1 when you change the animation to the one you want to be locked. Then in its animation finish event set it back to 0. Lastly, anywhere you have a different change animation, use an if statement to check if it is 0 before changing. This isn't a very nice solution though, so I do suggest you look into the state method. http://game-editor.com/State_Method
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: run animation

Postby Behdadsoft » Mon Jun 11, 2012 7:30 am

Hi. :D
It will be fully implemented before the animation ends. It runs for a second and can not know exactly what does the animation runs.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest