Delay? WaitTimer? WaitEvent? Delta timing?

BlitzPlus Forums/BlitzPlus Programming/Delay? WaitTimer? WaitEvent? Delta timing?

I had this problem a bit ago...

Ok, the basic difference between DELAY and WAITTIMER is that delay slows down your program based on time, whereas WAITTIMER slows down your program depending on frames per second.

If you can use DELAY, that's fine, but you may find sometimes that using DELAY can produce undesired slowdowns in some processes (I can't explain it very well but you'll know when you experience it)

The reason you can't use WAITTIMER is because you need to update your version of blitz. You can do this under the account tab on the Blitz Basic site, then going to product upgrades.

As for delta timing, it regulates your program using time, but does it in such a way that everything is slowed down in proportion. I use delta timing to speed up programs for slower computers, using this bit of code:
;speeding up a game for slower computers

;place this in initialization
Global SpeedFactor#=1.0
Global GameTime=5
Global FrameTime=MilliSecs()

;place this in main loop
SpeedFactor#=Float(MilliSecs()-FrameTime)/Float(GameTime)
FrameTime=MilliSecs()

;multiply every addition equation by SpeedFactor#
x=x+1*SpeedFactor#


As you can see, it takes the frame time and divides it by your desired game time. And that in essence is delta timing.

I hope this helps, good luck.