The answer is:
If you want to move 1 unit per second, you do this.
Refresh = screen fps()
xratio# = 1/refresh
x# = x# + 1*xratio#
-Basically, save the screen fps() to a variable (ONLY EVER CALL SCREEN FPS() ONCE PER SYNC)
-Define all your movements to be how far to move in one second.
If you have 100FPS then the above code will run 100 times in one second. x=x+1*(1/100) when run 100 times will be equivilent to x=x+1 ran once. Basically:
x=x+1*(1/100) Ran 100 times =
x=x+1*(1/60) ran 60 times =
x=x+1*(1/1) ran once.
So to summarise that:
(1) Save Screen FPS() to a variable at the start or end of your program loop. Never ever call it more than once per loop.
(2) Make a variable TimeRatio# or something be equal to (1/ScreenRefesh)
(3) Define all your movements as how far to travel in one second.
(4) Multiply them all by TimeRatio#
It's worth point out however that although:
x=x+1*(1/100) ran 100 times
and
x=x+1*(1/20) ran 20 times
are the same, this is not ...
x=x*10*(1/100) ran 100 times
and
x=x*10*(1/20) ran 20 times.
Basically, only additions of values can be times by the ratio. Multiplications (which are more complex movements anyway) cannot.
Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)