ok don't worry bloodimage i used puppy of kosh's method and i also loaded in a new picture for my ship (looks way better) and the asteroids that appear randomly that dark gdk loads when you first click on Make new Dark gdk 2d game. my question is (sorry about all of this) how do i make it so that the asteroids and the ship blow up when they collide here is my code
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#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
dbLoadMusic ( "background music.mp3", 4 );
dbSetDisplayMode ( 1024 , 768 , 32 );
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbRandomize ( dbTimer ( ) );
dbMaximiseWindow();
dbLoadImage ( "background.jpg", 1 );
dbSprite ( 1, 0, 0, 1 );
for ( int i = 3; i < 30; i++ )
{
dbCreateAnimatedSprite ( i, "sprite.png", 4, 4, i );
dbSprite ( i, dbRnd ( 640 ), -dbRnd ( 1500 ), i );
}
int g = 2;
int XCord=100;
int YCord=100;
dbLoadImage("spaceship.png", g);
dbSprite(g, XCord, YCord, g);//this will display the object
dbPlayMusic(4);
dbLoopMusic(4);
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 (XCord > dbScreenWidth())
XCord = 0;
if (XCord < 0)
XCord = dbScreenWidth();
if (YCord > dbScreenHeight())
YCord = 0;
if (YCord < 0)
YCord = dbScreenHeight();
for ( int i = 2; i < 30; 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 ) > 768 )
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;
}
attatched is yet another picture