Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Screen flickering with sprites

Author
Message
glitch55
13
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 8th Nov 2010 00:39
I've been making a pong game and i have a problem. At first i used basic 2d to create the table and it was fine. then when i put i sprite on the screen and run it, the screen starts to flicker. I don't know if you can't use basic 2d and sprites together or you have to do something else.


Thanks
Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 8th Nov 2010 03:24
You need to clear your screen first before drawing, then do the syncing, make your code look like this for the "while (LoopGDK())" loop:



You need to do this because the Basic 2D commands are drawing commands. And if you don't clear the canvas (in this case, the screen), things look right.

http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.
glitch55
13
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 8th Nov 2010 04:19
Thank you so much
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 9th Nov 2010 19:42
Also put the dbSetWindowTitle and dbMaximizeWindow before the loop. You only need to do these once, not at every screen refresh.

Login to post a reply

Server time is: 2024-06-30 10:48:33
Your offset time is: 2024-06-30 10:48:33