Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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++.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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).

share|improve this answer
    
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. –  Peter Serwylo Mar 21 '12 at 12:07
    
This does not help with the original question. Are there any JBox-2D tutorials that you know of? –  ylun.za Mar 3 at 17:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.