ok here goes..... i am trying to make a 2d space sort of game but, i cannot set the background on the image
space.bmp which is my spaceship to transparent so all that happens is i get a purple box surrounding my spaceship
any help would be grately appreciated
oh yeah here is code:
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSetDisplayMode ( 1024 , 768 , 32 );
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbRandomize ( dbTimer ( ) );
dbMaximiseWindow();
dbLoadImage ( "stars.jpg", 1 );
dbSprite ( 1, 0, 0, 1 );
dbSetImageColorKey ( 255, 0, 255 );
int g = 2;
int XCord=100;
int YCord=100;
dbLoadImage("space.bmp", g);
dbSprite(g, XCord, YCord, g);//this will display the object
while ( LoopGDK () )
{
if(dbDownKey())//move down
{
YCord++;
YCord++;
YCord++;
YCord++;
YCord++;
}
if(dbUpKey())//move up
{
YCord=YCord-5;
}
if(dbRightKey())//move right
{
XCord++;
XCord++;
XCord++;
XCord++;
XCord++;
}
if(dbLeftKey())//move left
{
XCord=XCord-5;
}
dbSprite(g, XCord, YCord, g);//Set The Cordinates To XCord And YCord
if ( dbEscapeKey ( ) )
break;
dbSync ( );
}
for ( int i = 1; i < 30; i++ )
dbDeleteSprite ( i );
dbDeleteImage ( 1 );
}
a picture of the game is attatched