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.

Newcomers DBPro Corner / Critique my code please

Author
Message
womo1975
19
Years of Service
User Offline
Joined: 26th May 2005
Location: Oak Harbor, WA
Posted: 6th Jun 2005 20:35
I want to know if I\'m handling the bitmaps correctly. My theory is that you load the background bitmap and the player bitmap before the main game loop and draw it out. When the process hits the main game loop if a change occurs then you redraw everything and by using the sync command after the cls command you don\'t have the flicker problem. It took me a while to understand this concept but I think my code is solid now. Any critiques would be very welcome.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Jun 2005 21:59
If you use the SYNC ON command at the top of your program, the display will only be updated when the SYNC command is reached.

DBC and DBPro effectively do what you want behind the scenes (it's called double buffering - draw to one bitmap while showing another, then swap them each frame). Without using SYNC ON, the swap between the two bitmaps happens unpredictably.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-09-23 21:25:41
Your offset time is: 2024-09-23 21:25:41