2
\$\begingroup\$

So I did some research and a found Box2d. I then proceeded to download it and the testbed. Now that i have it, I don't know how to properly use it. I'm looking for a clear simple answer on how to use the engine.

The things I did was that I put it into a lib folder and referenced the JBox2D jar file. After that i got stuck. How can i use this to program games for android?

I'm very confused since Box2d was intended for C++.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

I've just started using libgdx (http://code.google.com/p/libgdx/) for Android development. They have a JNI wrapper for Box2D (java wrapper for the native code). They also have plenty of example code which you can look at to see how they use Box2D.

If you view the video at their Google code page, it will explain how to easily setup a project. Then you may want to go to the wiki, or I found that the guy at http://steigert.blogspot.com.au/ is working his way through an extremely comprehensive but easy to understand tutorial.

If you are interested in looking straight at some Box2D code which runs on Android, here are plenty of tests here:

http://code.google.com/p/libgdx/source/browse/#svn%2Ftrunk%2Ftests%2Fgdx-tests%2Fsrc%2Fcom%2Fbadlogic%2Fgdx%2Ftests%2Fbox2d

There is also source code for complete games, some which use Box2D:

http://code.google.com/p/libgdx/source/browse/#svn%2Ftrunk%2Fdemos

You'll find development quite fast, because you can run your games on a PC as well as on the phone, so most of your debugging will be done on the PC. The process for setting up both the PC and the Android code is described nicely in the video I described above (the guy narrating is quite funny).

\$\endgroup\$
2
  • \$\begingroup\$ Hmmm, I realise that I sound like a salesman here, but I'm not affiliated with them. Haven't made any contributions (yet) and am not actually all that experienced with this particular library (yet). I just quite like the cut-of-their-jib. \$\endgroup\$ Commented Mar 21, 2012 at 12:07
  • \$\begingroup\$ This does not help with the original question. Are there any JBox-2D tutorials that you know of? \$\endgroup\$
    – ylun
    Commented Mar 3, 2014 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .