Farseer Physics in MonoGame

screenshot_02132013_165926

I really like MonoGame. I also like physics. Particularly the Farseer engine, which works very well with XNA and lets you make things bounce around very nicely. I’ve had some success putting Farseer on Windows Phone, so today I thought I’d see if I could get Farseer to work with MonoGame. So I opened up my venerable old Destruction Golf demo from ages ago and just copied across the Farseer library and the code.

And it worked. Pretty much first time. Took me fifteen minutes in total. Amazing. The only problem was with the sound effect that plays when the ball hits the house. This wouldn’t play for some reason. But everything else seemed to move very realistically. If you want to add a bit of physics to your XNA then it is well worth a look. It is the older version of Farseer, but I kind of prefer that.

You can find the sample code for MonoGame Windows 8 here. You can find my video presentation about how the code works here.