I actually had the same problem too. Still technically haven't solved the problem 100%, but for the most part, this is what I have done "with the help of the tutorial" to fix that problem.
have a variable something like.
int iPlayerFrame;
and then use the command dbSetSpriteFrame ( 1 , iPlayerFrame );
I did something like this.
int iPlayerFrame = 6;
int iFrameAnimateDelay = 0;
dbCreateAnimatedSprite ( 1, "playerpallet.bmp", 3, 3, 1 );
dbSprite ( 1, 0, 0, 1 );
void playerAnimate ( void )
{
// firstly increment the animation delay
iFrameAnimateDelay++;
if ( iFrameAnimateDelay > 8 )
{
// reset the delay and lets go animate
iFrameAnimateDelay = 0;
if ( checkLeft() )
{
iPlayerFrame = iPlayerFrame + 1;
if (iPlayerFrame > 6)
iPlayerFrame = 1;
}
if ( checkRight() )
{
iPlayerFrame = iPlayerFrame + 1;
if (iPlayerFrame > 12 || iPlayerFrame < 7)
iPlayerFrame = 7;
}
I'm not good at guessing what sprite frame you want to do with what
but for the most part, you should see that it changes much quicker then with the dbPlaySprite command, since it actually wants to finish the set of frames you told it to play. Change the numbers as you see fit.
I removed two if statements I had that would check which way you where facing, but I would recommend you make a bool that checks if your facing a certain direction as well.