Hi!
Thanks for the answers, but none of them works for me.
Maybe it's my fault, perhaps you could try your recommendations at home if you've got time.
(setAnimationEndCallback(0); does nothing for me)
I could only achieve this:
Code: Select all
int currentAnim = 0;
...
void enemyReact()
{
if(currentAnim == 0){
// hit-taking animation
node->setLoopMode(false);
node->setFrameLoop(272,288);
currentAnim++;
}
else if(currentAnim == 1){
// walking animation
node->setLoopMode(true);
node->setFrameLoop(0,24);
currentAnim=0;
}
}
The enemyReact function is called when the enemy takes hit.
For the first hit, the hit-taking animation runs, then the enemy stops.
For the second hit, it just starts walking again.
The third is like the first,etc,until it dies. The dying animation works well.
But this isn't the right way, because I want the walking anim right after one hit-taking anim.
But ANYHOW I call the walking animation after the other animation, the first one gets ignored. It's kinda frustrating..
Isn't here someone who experienced or dealt with this before?