O'Reilly logo

LibGDX Game Development By Example by James Cook

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up LibGDX with Box2D

Right, we need a LibGDX project that has Box2D support. The question is, how do we go ahead and create that? Well, the eagle-eyed among you will have noticed that Box2D was a selectable option in the project setup application we used previously and in fact it will have been already preselected!

Setting up LibGDX with Box2D

The preceding partial screenshot of the setup application shows what you see when you rerun the application.

Set up the application like we have done so previously, but with Box2D ticked, and then we are good to go!

Code reuse

Next, before we dive into Box2D, let's reuse some code from our previous projects.

Firstly, we should update ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required