Hi, We are uploading source code of a simple box2d-libgdx example. Here is the File In the attachment you would find three projects :-
UPDATE :- The example now contains box2d debug renderer also which can be used to render box2d objects.
Copy them in your eclipse workspace and import the projects in the following way:
- File->Import->General->Existing Projects into Workspace
- Then set root directory by browsing to the directory where the above three folders were copied. Then the above three projects would be seen listed.
- Then click Finish.
Finally you would have to a link source of android project to desktop project so that both projects use same source of assets. Right click on BoxLibgdxExample-desktop in Package Explorer in Eclipse and in Build Path go to Link Source. Browse to the assets folder of BoxLibgdxExample-android and then build all the projects. Run the desktop project as Java Application and select DesktopGame.java. That should run the example.
For Android Code just check if the build path matches the below screenshot.
If you have any issues please post the problem in comments and we would try to solve it. Thank you for the patience