I think this is right
Blitz3D Forums/Blitz3D Beginners Area/I think this is right The value of 'oldtime' should be set to the current millisecs time after the 'millisecs - oldtime' line above rather than before it.
It's also a good idea to grab the value of the 'MilliSecs()' timer and stick it in a Global at the start of your main loop so you're not making repetitive calls to 'MilliSecs()'.
eg.
Global current_time
Global oldtime
;-----
current_time = MilliSecs()
time_elapsed = current_time - oldtime
oldtime = current_time
It's also a good idea to grab the value of the 'MilliSecs()' timer and stick it in a Global at the start of your main loop so you're not making repetitive calls to 'MilliSecs()'.
eg.
Global current_time
Global oldtime
;-----
current_time = MilliSecs()
time_elapsed = current_time - oldtime
oldtime = current_time
Always remember the () after Millisecs, otherwise it returns 0 or something!
yeah :) once i forgot to put () after GraphicsHeight and width in Cameraviewport command. i spent hours on trying to find out what was wrong :)
never do this
never do this
Cameraviewport camera, 0, 0, GraphicsWidth, GraphicsHeight
kk
Another thing to remember is to set the value of 'oldtime' to the current 'MilliSecs()' time both before starting your main loop, and also after returning from a pause.