Här kommer en skärmdump på mitt senaste projekt som bygger på Farseer Physics Engine till XNA.

Och här kommer en kort film som visar speltestet.
About jumping:
My first idea was to apply an impulse for jumping the character. This would however break Newton’s third law of motion (action-reaction) which isn’t really a problem as long as the ground is all static. But since I wanted my character to run around and jump from movable objects (like the rope bridge) and I wanted the bridge to be affected by the impulse as well I could not use a single impulse. Instead I created a compressed spring between the character and the ground object for a short time period.
About collission:
The problem with inCollision is that two objects in contact in reality keep bouncing against each other which makes the onCollision being called every other update. Therefore the onCollision event has the be smoothed out over several updates. I think I saw some discussions about these in the forum at http://www.codeplex.com/FarseerPhysics
About gravity:
The gravity is applied by, for each object looping through every other object and calculating the resulting gravity force between them, like this:
foreach body1
gravity=0
foreach body2 != this
gravity += G*m1*m2/r^2
end
body1.addforce(gravity)
end
where G is a constant, m1 is the mass of body1, m2 the mass of body2 and r is the distance between them.
![]()
http://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation