Game Test using DarkGDK
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
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(); }}
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 ().
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement