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 / I need help with what I thought was timerbased!

Author
Message
darkvee
19
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 14th Jul 2009 23:05
Hi this is Vee
I thought timerbased was this
if timer() > oldtimer + 25
runGame()
oldtimer = timer()
endif
However I just found thats not how its done.
Also i'm not using the right way of doing it, but its not working.
The balls don't even move. lol
So here is my code



Vee
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 15th Jul 2009 00:36
Did a search, try this:
http://forum.thegamecreators.com/?m=forum_view&t=149887&b=7



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 15th Jul 2009 02:51
here

hope it helps a bit

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Jul 2009 07:15 Edited at: 15th Jul 2009 07:15
Either way works. The method IanM mentioned in that thread is to prevent integer rollover which would mess up the timing in a program. Using the first method rollover would take running your program for 23 days straight. Using the second method (IanM's method) rollover would take running your program for 47 days straight.



Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th Jul 2009 01:18 Edited at: 16th Jul 2009 01:19
Try making ElapsedTime into a float variable and changing /1000 to /1000.0. This way you are dealing with floats which can have decimals and not integers which can't. Or try any of the other posted suggestions

<-- Spell based team dueling game!

Login to post a reply

Server time is: 2024-11-25 05:00:55
Your offset time is: 2024-11-25 05:00:55