Firstly let me explain that i am new to this, i do know c++ quite well and have written a number of business applications on wx-Dev however i am new to game development and also MS VSE++.
Also not trying to brown nose but dark gdk is so good and from following the tutorials that came with the program i can see how great it is already!
Now on to the question.
Basically what i was wondering is in my Player class i would like to play an attack sprite animation which is frames 4 - 6 on my sheet (the game i'm making is only basic just starting out) anyway i'm under the impression that in order to use dbPlaySpite it must be called the amount of times it needs in a loop, but i'm not sure of the best way to do this
i.e would
if ( input.checkAttack() )
{
// animate
int count = 1;
bool animation_finish = false;
while(LoopGDK ( ) && !animation_finish)
{
dbPlaySprite(1, 4, 6, 200);
dbSync();
++count;
if(count == 3)
animation_finish = true
}
// start player standing again
dbSetSpriteFrame ( 1 , 3 );
}
Just wondering what the best way is to do it then when i know that i can do that for the baddies as well.
Any help would be appreciated, thanks.
EDIT: I've seen alot of examples where people play the animations in the main.cpp while loop, i didn't like the idea of that as i wanted to have what the player was going to do in the player class and what the bosses or bad guys where going to do in their class.
I'm brand new to games programming though so any help would be great!
EDIT: Is there a function that plays the animation once, or like i said before is there a set way of doing things in d-gdk.