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 / Game Speed / Framerate / Main Loop

Author
Message
Jaidex
23
Years of Service
User Offline
Joined: 28th Jan 2003
Location:
Posted: 5th Feb 2003 00:36
Could somebody show me the right way to go about writing my main game loop so that it will run consistantly on machines of different speeds? I'm assuming that there's some sort of a timer involved with the sync, or something like that. I'm trying to figure out how some games run really smoothly on a fast machine, but at the SAME SPEED (only more jumpy from frame to frame) on a slower machine.

Thanks in advance!
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 5th Feb 2003 00:54
I have a simple example in my code for the "Sprite problem (bug) Rich" post in the 2D forums boards. Have a look at my code and you'll see how I did it. I had on set of variables for the animation speed of the character, and one for how fast the level scrolls - its based on the timer() as you correctly guessed. I'm not saying the code there is air tight, it wasn't meant as an example for this - but it should give you a pointer

Coming Soon! Kangaroo2 Studio... wait and quiver with anticipation! lol
[email protected] - http://www.kangaroo2.com - If the apocalypse comes, email me
Jaidex
23
Years of Service
User Offline
Joined: 28th Jan 2003
Location:
Posted: 5th Feb 2003 21:21
Thanks a lot, I'll take a look!

Jai

Login to post a reply

Server time is: 2026-07-26 08:18:33
Your offset time is: 2026-07-26 08:18:33