O'Reilly logo

Building a 3D Game with LibGDX by Elmar van Rijnswou, Andreas Krühlmann, Sebastián Di Giuseppe

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

Adding a SkyDome

If we want to be in space, we will need to give our players a bit of context. We may want to add something similar to a SkyDome that represents where we are.

Getting the model

As mentioned before, there's a number of different ways to get 3D models. We will take the one SkyDome that is in the LibGDX tests, but you can model your own if you want and add your own charm.

Or you can get it from our repository

(https://github.com/DeeepGames/SpaceGladiators/tree/Prototype/android/assets).

Implementing

After pasting the files in the Assets folder, let's make the additions for the dome. Let's make the following changes to GameWorld.java:

public class GameWorld { ... private Entity dome; ... private void loadLevel() { ... engine.addEntity(dome ...

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