why cant i see my player? here is the main code this is my first time using a code so i dont know it will work.
#include "DarkGDK.h"
#include "player.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbLoadImage ( "backdrop.bmp", 1 );
dbLoadImage ( "player.bmp",100);
dbSprite ( 1, 0, 0, 1 );
dbSprite ( 2, 10, 10, 100 );
dbSetImageColorKey ( 255, 0, 255 );
// in this loop we're going to create some animated sprites, the image
// we load contains frames of animation for an asteroid
for ( int i = 2; i < 60; i++ )
{
int gap = 1;
int Yblock = 0;
int Xblock = 0;
// create an animated sprite and give it the ID number from the
// variable i, next is the filename, now we come to how many frames
// across and down, in our case this is 4, finally we come to the image
// ID that the sprite will use, again we use i
dbCreateAnimatedSprite ( i, "Block.bmp", 2, 2, i );
Xblock = dbSpriteX(i)+dbRnd(gap);
Yblock = dbSpriteY(i)+dbRnd(gap);
// position our sprite at a random location
dbSprite ( i, Xblock, -Yblock, i );
}
// now we come to our main loop, we call LoopGDK so some internal
// work can be carried out by the GDK
player player;
while ( LoopGDK ( ) )
{
player.movement();
// run a loop through all our sprites
for ( int i = 2; i < 60; i++ )
{
// move the sprite down and play its animation
// moving from frame 1 to 16 with a delay of 60 ms
dbMoveSprite ( i, -2 );
dbPlaySprite ( i, 1, 16, 60 );
// check the position of the sprite, if it has gone off scren
// then reposition it back to the top
if ( dbSpriteY ( i ) > 500 )
dbSprite ( i, dbRnd ( 640 ), -dbRnd ( 1500 ), i );
}
// here we check if the escape key has been pressed, when it has
// we will break out of the loop
if ( dbEscapeKey ( ) )
break;
// here we make a call to update the contents of the screen
dbSync ( );
}
// when the user presses escape the code will break out to this location
// and we can free up any previously allocated resources
// delete all the sprites
for ( int i = 1; i < 30; i++ )
dbDeleteSprite ( i );
// delete the backdrop image
dbDeleteImage ( 1 );
// and now everything is ready to return back to Windows
return;
}
why is this not working? my player will not show up.