Jump to content
  • Advertisement
Sign in to follow this  
Kurama_gamer

Game Test using DarkGDK

This topic is 3837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, It has been a while that I wanted to program games, and my first contact with this programming part was with the DarkGDK, and now that I got some free time I started playing with it. I decided to make my version of Space Invaders using this library, following a tutorial included in the folder of this library. Then, I read it and basically wrote down the whole code myself to get every single detail of it. Then I decided to make a test, to create a window with a space background and a spaceship that goes left and right on the screen. I developed its code, cleaned it up the maximum I could, build it, no errors no warnings no nothing is found (good =D), but when i run it boom... a window is drawn, not in fullscreen as I set in the code, and it keeps blinking (refreshing) and nothing else appears >:( So I come here to ask for help =D I hope someone that knows DarkGDK can help! My complete code is here: http://www.badongo.com/file/9935964

Share this post


Link to post
Share on other sites
Advertisement
void DarkGDK ( void )
{
while ( LoopGDK() )
{
gameSetup();//<--Right there
dbSync();
}
}

Well that would be the problem--calling gameSetup every frame. Should be:
void DarkGDK ( void )
{
gameSetup();
while ( LoopGDK() )
{
playerUpdate();
dbSync();
}
}

Share this post


Link to post
Share on other sites
Just a small unrelated note - in C++, there is no need to write "void" in an empty argument list, just write empty parenthesis, e.g., void backgroundSetup ().

Share this post


Link to post
Share on other sites
Thanks TheDirt, really just a little thing can make all the difference!

And I also had to add a backgroundUpdate() function which draws the sprite of my loaded image and add that to my loop =D
And add a line at my playerUpdate() function, corresponding to the creation of my sprite.

And thanks for the tip Gage64 =D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!