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.

DarkBASIC Professional Discussion / Using Sync Rates and Text Help

Author
Message
Sir_Herbert
11
Years of Service
User Offline
Joined: 6th Nov 2013
Location: The InterWebz
Posted: 27th Jan 2014 19:29
I have been making a game in class and have gotten pretty far. I have done the whole thing without using a sync rate and now I need to print something and have the variable decrease on the screen. I believe I have the right code for it to do so, but I think I need to add a sync rate. I have tried to add one and It makes to the game extremely laggy when the sync rate is at 60. Also, it will not show the text at the beginning of the game. How do I dcrease the variable on screen. (Variable is located towards the bottom of the code) Thanks

BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Jan 2014 21:23 Edited at: 27th Jan 2014 21:23
As soon as you take over the syncing of the code, it will not display anything on the screen until you SYNC. So in each of your text screens you need to SYNC after writing the text. (This isn't the best way to do this, but for now it will fix the problem).

You then need to add the SYNC to the end of your main DO / LOOP just before the loop. Is this what you did, because this should not be laggy with a small loop like this.

SamKM
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 27th Jan 2014 22:32 Edited at: 27th Jan 2014 22:34
Just to clarify about SYNC RATE, it caps the frames per second (fps), which is how many times your screen updates per second. If you set the sync rate to 60, your screen won't refresh any more than 60 times a second, maximum. Since it was probably already running at more than 500 without that command, adding it will make things run slower
You don't need to use it, unless you want to set a limit to how fast your game can run.
Just a note: You can get the current number of frames per second by using the SCREEN FPS() command!

Login to post a reply

Server time is: 2025-05-15 13:06:46
Your offset time is: 2025-05-15 13:06:46