Physics engine for 2d games?

Started by
0 comments, last by Misantes 9 years, 7 months ago

I want to make a sidescroller hack n slash game, I decided to use SFML to take care of audio and rendering but, What engine can I use to take care of the physics part?

I don't know a lot about physics, I only know something about forces. Anyway, I'm willing to leatn about everything else(read somewhere that i need to understand rigid bodies, impulse and torque), but if you know an engine that can make it easier, I'd be very grateful.

Advertisement

edit* just re-read that you're making a sidescrolling hack n' slash. Ignore the top-down comments, but everything still apples otherwise.

Depending on your needs, you may not need a 3rd party physics engine and it may just be overkill for your game. You could program the gravity and collision yourself, and if you're making a top-down hack-n-slash, you're unlikely to even need gravity. I don't have a good tutorial for collision detection offhand, but if you'd like I could dig one up that I found helpful. There are a few methods for 2d collision with varying pros/cons.

For actual physics, your needs probably aren't all that demanding for a 2d hack and slash, but http://www.rodedev.com/tutorials/gamephysics/ is a pretty great start for basic game physics programming. Rigid bodies and torque and such may not actually be relevant to your game.

If you're set on using a physics engine, http://box2d.org/ is open-source and has most of your bases covered. There are certainly others though, and perhaps someone else will have a better recommendation.

Let me know if you need any clarification or links to resources,

Cheers smile.png

edit*

here are a couple links for sfml collision I found useful:

bounding box collision:

tile map collision(easy):

tile map(intermediate)

tile map(harder)

Beginner here <- please take any opinions with grain of salt

This topic is closed to new replies.

Advertisement