Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: leafy on January 20, 2011, 02:35:27 am

Title: linear momentum
Post by: leafy on January 20, 2011, 02:35:27 am
How would you go about programming linear momentum in the x axis? for instance starting slow then easing into fast and when you stop pressing the arrow keys it takes a while to stop.
Title: Re: linear momentum
Post by: Binder News on January 20, 2011, 06:36:41 am
I have an example of this.
It uses GDB1XS (I think) for the X speed. I used data for everything. Very few actual vars used.
Feel free to modify, but please give me credit.
Title: Re: linear momentum
Post by: squidgetx on January 20, 2011, 07:19:17 pm
Basically you'd have a velocity and a change-in-velocity variable. Every frame velocity is increased by the change in velocity. Pressing keys would increase the change in velocity, and if no keys are pressed and the velocity is not 0, the velocity would decrease.

Or something like that (note: I didn't look at Binder News' program yet :P)
Title: Re: linear momentum
Post by: leafy on January 20, 2011, 09:57:33 pm
@Binder News could you document your code? I don't fully get what some of it means.
Or you could just explain what it means or something.