Help with Animation

Blitz3D Forums/Blitz3D Programming/Help with Animation

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I need to know whether the speed parameter that specifies how fast to run an animation in the

Animate entity, [mode,] [speed#,]... command is based on an actual speed or whether this is a measurement and not a speed.

I guess what I am trying to ask is will I have to adjust my speed parameter based upon how many loops I am getting per second.

I originally figured speed meant, well, speed, not a certain amount of the animation per UpdateWorld(). However I notice that no matter how much tweaking I do to my values they always seem to be off when I try running my game again.

I'm using functions to calculate speed by dividing them by the loops/second, not render tweening, so if this speed# parameter is affected by how fast the game is running I need to know. Unfortunately I am not getting varied enough speeds on my own computer to see if I am correct in my assumption...

simply use the speed value that looks best on your machine. Then use the Parameter of the UpdateWorld(t#) Command where t# has to be the frametime, something like:

t=millisecs()-17 ; (prevent division by zero)

while not keydown(1)
 t2=t
 t=milisecs()
 computer_speed#=float(t-t2)/16.67
 ...
 updateworld(computer_speed#)
 renderworld()
 flip
wend


Now the animation should look the same on all machines.

You can add a "Delay 50" somewhere to simulate a slow machine.

Well it really doesn't matter whether I calculate the speed within my code or through update world... I have a whole library of functions that calculate values for them. All I needed to know was if my suspicions were correct. Thanks you for confirming them, I will start modifying the animation speeds.