Im trying to program a game were you can move a sprite on the screen with the arrow keys. For some reason after I made the sprite, it cuts off half the background picture. Before I spawned the sprite into the game, the full background was there. code is here:
// 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
dbSyncOn ( );
dbSyncRate ( 60 );
//disables escape key while loading game
dbDisableEscapeKey();
//load background into game
dbLoadImage( "haloman.bmp", 1 );
//sets background to haloman
dbSprite( 1, 0, 0, 1 );
//makes the color BRIGHT PINK transparent
dbSetImageColorKey( 255, 0, 255 );
//load the music into the game
dbLoadMusic( "Trust.mp3", 3 );
//this is the loop used to load our character
for ( int EvilGuy = 2; EvilGuy < 30; EvilGuy++ )
{
//create a sprite in game
dbCreateAnimatedSprite( EvilGuy, "Sprite.bmp", 1, 1, EvilGuy );
dbSprite( EvilGuy, 100, 100, EvilGuy );
}//end the for loop
// our main loop
while ( LoopGDK ( ) )
{
//Play the music
dbPlayMusic( 3 );
//if escape key is pressed break the loop
if( dbEscapeKey () )
{
break;
}
//update the screen
dbSync ( );
}
//stops the music in game
dbStopMusic( 3 );
//deletes background image
dbDeleteBitmap( 1 );
// return back to windows
return;
}
If anyone can help that would be sweet, thanks!
This is a signiture