Sign in to follow this  
ochi12

Physics engine for 2d games?

Recommended Posts

ochi12    184

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.

Share this post


Link to post
Share on other sites
Misantes    2092

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:

http://www.youtube.com/watch?v=n0U-NBmLj78

tile map collision(easy):

http://www.youtube.com/watch?v=eGtilgKUCV8

tile map(intermediate)

http://www.youtube.com/watch?v=EZSPobXSGMk

tile map(harder)

http://www.youtube.com/watch?v=QCUZG9o4AVY

Edited by Misantes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this