<br><br><div class="gmail_quote">On Wed, Jan 14, 2009 at 12:29 PM, killsto <span dir="ltr"><<a href="mailto:kiliansto@gmail.com">kiliansto@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
force. So lets say I am slowing down at a rate of -2m/s^2, if I hit 1,<br>
the next number will be -1 and I shoot off in the other direction. How<br>
do I fix this an still have backwards movement?<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br><div>try something like: </div><div><br></div><div>force = max(force, 0)</div><div><br></div><div>where force is the force applied to the object that you have calculated. </div><div><br></div>
<div>this should ensure that the force is bounded to 0 in the negative direction. </div><div><br></div><div>I believe that in pygame you can use the clock module to help you with your timing issues (see the docs), and</div>
<div>perhaps attempt to keep a regular frame rate.</div><div><br></div><div>Cheers,</div><div><br></div><div>Jervis</div>