O'Reilly logo

LibGDX Game Development Essentials by Juwal Bose

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

Box2D version of Thrust Copter

With what we have learned so far, let's try to completely redo our game scene to use Box2D instead of our old code. First, check whether the Box2D library is retrieved with Gradle, as explained earlier in this chapter. We will retain all the old source as well as that will still be our real game. Create a new folder Box2D within the current package and create a new ThrustCopterSceneBox2D class, extending BaseScene within this new folder. So, all our Box2D-related classes will be placed in this new package, com.csharks.thrustcopter.box2d. We will reuse some of the code from the original ThrustCopterScene class, but we will change the code for movement, rendering, and creation of items.

Creating and placing objects ...

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