Another q. about time based movement

Started by
15 comments, last by Redoc 20 years, 11 months ago
Airo: Thanks, would that work on negative speeds though? Just a thought..

AP: thanks for that too! Im not sure why PI is in the formulae, what is ''e'' for?

And about this:

x = x * (e ^ (k * t))

This is just my version I can read better, I want to see if that read the same as the formulae Sneftel has (I dont know how to make the floaty letters / numbers )

Thanks again
Advertisement
you should be careful with x subscript 0, it is different to x. (x sub 0 is a constant)
e is an un-natural number made up by mad scientist.
quote:Original post by Anonymous Poster
Secondly e does not equal 2.71... it is infact 3.14... I''m sure everyone will agree on this point too.

Yeah, I''m sure they will...
pi/pi = 1
e/e = 1,
thus it stand to reason pi = e
quote:
maybe you could use a different approach?

like speed += acceleration*time-elapsed;

i agree. here is an example:

  double last_frame=/*time last frame*/;double this_frame=GetTickCount();double delta=this_frame-last_frame;double x=0.0f,y=0.0f;// speed==amount of pixels you want to move// in a secondint speed=300;x+=((float)delta/1000)*speed;  



doh, nuts. Mmmm... donuts
My website
Thanks for all the messages so far.

Brassfish, I know how to speed my object up I need to know how to slow it down naturally.. What I have done to slow the sprite down works exactly how I want it here:

float SlowRate = 0.96;

// each frame aceleration is added (Speed += Aceleration * FrameTime)
// then to slow down I have
Speed = Speed * SlowRate;

BUT, on fast computers the speed slows very FAST and on slow computers it slows slower. I want to adapt that formulae to reach 0 no matter what FPS is at.

Does that make sense? I hope it does. thanks

This topic is closed to new replies.

Advertisement