Hi,
first my Source Code:
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetDisplayMode(800,600,32);
//Variablen...
int XCord = 171;
int YCord = 180;
//Bilder und Sprites laden.
dbLoadImage("Men1.png",1);
dbLoadImage("back.bmp",2);
dbSprite(2,0,0,2);
//Sprite Animaton erstellen.
dbCreateAnimatedSprite(10,"Men1.png",3,4,10);
while ( LoopGDK () )
{
dbSprite(10,XCord,YCord,10);
if(dbUpKey() == 1){
dbPlaySprite(10,1,3,200);
YCord--;
}
else if(dbDownKey()== 1){
dbPlaySprite(10,7,9,200);
YCord++;
}
else if(dbLeftKey()== 1){
dbPlaySprite(10,10,12,200);
XCord--;
}
else if(dbRightKey()== 1){
dbPlaySprite(10,4,6,200);
XCord++;
}
else dbSprite(10,XCord,YCord,10);
dbSync ( );
}
return;
}
The image contains 12 Sprites,
but if I run the Programm and hit the left Key to make my Men watch and walk left, the entire Animation is played.
Hope you understand my Problem.
Thanks.