Framerate independant linear interpolation is very important for making you're games run at the same speed on machines with different HW.
Framrate independant eased interpolation is great because not only does it offer the benefit of making you're game run the same on different machines, but it also looks really cool... You're characters speed up at the beginning of their movement, and slow down as they reach their target...
I really think DB needs to add a couple commands that do these two things. I know they are simple to implement, but DB is all about making it easier to write games...
Anyhow, here is my frame rate independant eased interpolation function. You pass in the start time of the animation, the duration (how long the animation should last) and starting and ending values (usually you're start value is you're characters current position, and you're ending value is where you want him to move to)... I'm also including a test function that visually shows the output of the interpolator (it looks like a sine wave)... You'll need to put some setup code around this to make it work, but that should be trivial...
function ease_interp( start_time# as float, duration# as float, from# as float, to# as float )
`DarkBasic's trigonmetric functions take degrees, not radians
`as this formula assumes. So they must be converted.
`(1+cos(t*pi))/2
now# = timer()
time_delta# = now# - start_time#
value# = (1+cos(((time_delta# / duration#)*3.14159)*(180/3.14159))) / 2
if from#