It's certainly a cool little Calculation to play with.
Yup just run this code, its really cool
REm Correct Speed Calculations(I Hope...)
Sync on
Sync Rate 60
Rem vars
Spd# = 0
Dist# = 3
Rem Remember, units of time will be in "Sync"
Time# = 1
L = 0
PositionX# = 230
PositionY# = 230
upkey = 0
REM LOOP!!!
Do
Print "Your speed is "+Str$(Spd#)
Print "Your Distance is "+Str$(Dist#)
Print "Your Time(Syncs per ??) is "+Str$(Time#)
Print
Print
Print "Press 1 for Normal Speed..."
Print "Press 2 for Half Speed..."
Print "Press 3 for Double Speed..."
Print "Press Up And Down TO Play With the "Time" Variable..."
Print
Print "Notice That The "Distance" that the box is moving is NOT Changing!!!"
If Time# < 0.1 then Time#=0.2
Spd# = Dist# / Time#
If PositionX# > 330 then L=1
If PositionX# < 230 then L=0
if L=0 then PositionX# = PositionX# + Spd#
if L=1 then PositionX# = PositionX# - Spd#
If upkey()=1 and upkey=0 then upkey=1 :inc Time#,0.1
If upkey()=0 then upkey=0
If downkey()=1 and downkey=0 then downkey=1 :dec Time#,0.1
If downkey()=0 then downkey=0
If Inkey$()="1" then Time#=1
If Inkey$()="2" then Time#=2
If Inkey$()="3" then Time#=0.5
Box PositionX#,PositionY#,PositionX#+7,PositionY#+7
sync
cls
Loop
To some this may seem like a dumb idea,because you can just use a speed variable then inc and dec as you need to, but think about it. The advantage lies in keeping the amount of distance you move the same. For instance, you could create a nice slow-Mo effect simply by changing Time#'s Value from 1 to 2.
That would also work to create a fast-motion Effect by Changeing the value to 0.5. if you change this Time# varible to slow stuff down and speed things up, it makes it easy to maybe....slow all the bullets down in a matrix game, along with the player and everything else. All you'd have to do is declare a global Time# variable, and make sure that all the objects(bullets and stuff) are effected by it!
Uh-oh, i'm doing math. *Looks for latch*
.........Well for now, lets just say i'm correct with everything
Useful, eh?
Ch-Ch-CHEERS!
-DD
(\__/) HHAHAHAHAHAH!
(O.o ) / WORLD DOMINATION!!!!!!!!!!
(> < )