Just got Dark GDK, skimmed the documentation, everything looks great! Created a new 2D game project, fiddled around with the example and ran into a snag.
If you're not aware of the example, its just a bunch of falling animated, randomly placed, sprites.
Now, what I'm trying to do is add a counter on screen that shows how many rocks have fallen. Here's the code inside the main loop.
double rocks = 0;
char buffer[50];
while ( LoopGDK ( ) )
{
for ( int i = 1; i < 5; i++ )
{
dbMoveSprite ( i, -8 );
dbPlaySprite ( i, 1, 16, 25 );
if ( dbSpriteY ( i ) > 500 )
dbSprite ( i, dbRnd ( 640 ), -dbRnd ( 1500 ), i );
rocks++;
}
sprintf(buffer, "%d rocks have fallen!", rocks);
dbText(0,0, buffer);
if ( dbEscapeKey ( ) )
break;
dbSync ( );
}
The screen prints "0 rocks have fallen!". Also it crashes upon exiting. What am I doing wrong?