2D Games with Physics

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • 2D Games with Physics

      Hey Guys,

      My question today is, does Bullet Physics have an option for restricting physical movement to 2 dimensions? I imagine it will be something to do with the constraints Mike talks about in the book. Or is there a better option to go with for 2D? My reasoning for wanting to use a 3D Physics system like bullet is say you have a game like, Yoshis Island 64 where you are usually in 2D, but occasionally you will move up or down also, Paper Mario also does this.

      Would you utilize some kind of constraint only in certain zones to keep an object on a plane, where others allow you to move in all directions? We are thinking of making a kind of Donkey Kong style game, and would like to utilize 3D graphics for it
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • RE: 2D Games with Physics

      For pure 2D, I would suggest using Box2D. It's pretty much the gold standard for open source 2D physics. You should be able to make this work for 3D as well, as long as you constrain it to a single plane. Moving the plane would only change the render objects, not the collision objects, but you should be able to design around that problem, depending on what you're using physics for and how you're doing your transitions.

      You can probably achieve a similar look with Bullet or another 3D physics engine by constraining it to a single plane. I'm not sure whether it's better to try to make a 2D physics engine work on multiple planes or to force a 3D engine to constrain to a single plane. Personally, I'd start with the 2D engine.

      -Rez
    • I am checking it out now, I have to say, Box2D has the best looking, easy to read documentation I have ever seen
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • It say's right in the faqs page that you should have a good idea of C++ and basics of physics, everything else for setting up Box2D is right in the manual. Adding rigid bodies and shapes are all part of the interface and is fairly similar to Bullet.

      I meant more that they lay out every definition they use and made it clear and easy to read
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • Originally posted by kaykry
      I disagree; I read through the Box2D manual and did not find it to be a good learning resource. I'd recommend the iforce2d tutorials, if you want a practical usage guide:

      iforce2d.net/b2dtut/introduction

      I got a 404 error when I went to this page.

      Box2D has pretty good documentation, especially when compared to most open source projects. Their demo app is really cool; I was able to get similar constructs up and running very quickly thanks to all their working examples.

      I agree that it's not a good resource for learning physics programming, but that's not their goal. :)

      -Rez