I must be missing something very simple here.
Based on what I saw in the Esenthel Tutorials I did this;
Code:
if(Kb.b(KB_A)) // when A pressed
{
skel.animate("My Animation dropped here", Time.time()); // animate
}
It works if I have the attack animation set to looping, but isn't there a way to have it just play an animation once? If I turn off looping, it will play once (I assume because it is using Time.time) but not again.
I can't find any example of playing a single animation 'not looped' once anywhere. I googled it, I searched these forums and I checked the bloody massacre demo. That demo uses a little more advanced way of doing the animations, so I can't make any sense of it yet.
I can get it to work if I control the duration with a variable, but it seems redundant to have to do that. I feel like I should be able to just do this;
Code:
if(Kb.bp(KB_A)) // when A pressed
{
skel.animate("My Animation dropped here", PlayOnce); // animate
}
And that would be it instead I need to do this;
Code:
float attackPlay = 0.0;
if(Kb.b(KB_A) && attackPlay < 0.67) // when A pressed
{
attackPlay += 0.01;
skel.animate("My Animation dropped here", attackPlay); // animate
}else{attackPlay = 0;}