Search code examples
androidcocos2d-androidjbox2d

Setting up Cocos2D and JBox2D in Eclipse


I'm trying to make an Android app using Cocos2D-android and JBox2D. I found several tutorials and downloaded sample code and it works well and I can build on it, however nowhere can I find clear instructions for how to actually set up my own new project.

All I can see is:

  1. Import cocos2d in workspace.
  2. Go to project properties and mark cocos2d as library.
  3. create now your project and add cocos2d library in project properties.
  4. If you are using box2d maybe you had to add .so to your project like cocos(libs/...).

What does "Import cocos2d in workspace" mean ?

When I click import in Eclipse it doesn't let me import a .jar file. I tried adding the .jar the way I know: properties->Java Build Path->Add External Jars and it won't work (I can't use the Cocos2D libraries this way) I'm not sure I understand the 2-3 either.

Can anybody here please elaborate ?

Thanks.


Solution

  • Well, with this jBox2D jar and this cocos2d-android jar things work as expected, that is simply adding the jars to the libs folder in eclipse and right click each jar -> "build path" -> "add to build path.