Jacob Roman
Feb 17th, 2006, 01:47 PM
This is a very simple physics implementation that adds friction to your sprites which should make your game more realistic. It uses a 2nd Order Euler, which is more accurate than regular Euler:
x = x0 + v * dt - 0.5 * a * dt * dt
v = v0 + a * dt
Where a = f/m
It even includes a scalefactor to where you can make kilometers as big as you want in pixels.
Friction.zip (http://www.vbforums.com/attachment.php?attachmentid=44325)
x = x0 + v * dt - 0.5 * a * dt * dt
v = v0 + a * dt
Where a = f/m
It even includes a scalefactor to where you can make kilometers as big as you want in pixels.
Friction.zip (http://www.vbforums.com/attachment.php?attachmentid=44325)