Game Timing ..

BlitzMax Forums/BlitzMax Programming/Game Timing ..

Paul "Taiphoz"(Posted 2005) [#1]
Hay all.

I was wondering if the all important aspect of games design has come up yet in Max, in that I mean controlling the speed of our games.

Has anyone come up with anything new ? any new way's or edits to the existing tweening and dealta methods we have used in the past..


Lukasha(Posted 2005) [#2]
I don't know how you managed it in the past,
but I always take the time the program needs to run the main loop and save it in a variable (everytime the mainloop is passed).
Then I divide this number with the time it takes on my computer and save this in the variable "speed".
Now you can multiplicate any routine where it is needed with this speed.
For exampe: xpos = xpos + (1*speed)

If you don't understand this way of programming it because of my bad English send me an e-mail to
Lukasha@...


nawi(Posted 2005) [#3]
I do it this way

If MilliSecs() > WalkTimer + 50 then
 X = X + 1
 WalkTimer = MilliSecs()
EndIf



Robert Cummings(Posted 2005) [#4]
Didn't you just make a massive thread on this?


Paul "Taiphoz"(Posted 2005) [#5]
iu did, this is the post i couldnt find, thought it was a bug on the forum or something ... either way just ignore this and check the main thread. I'll link it in a few mins.


Paul "Taiphoz"(Posted 2005) [#6]
http://www.blitzbasic.com/Community/posts.php?topic=49713