Assembling the game world

We will now remove some of the old code that was used to draw test sprites. Additionally, we will add three new constants to define the amount of player lives and the viewport dimension of the GUI camera.

Change the code of the Constants class as follows:

public class Constants {
  // Visible game world is 5 meters wide
  public static final float VIEWPORT_WIDTH = 5.0f;
  // Visible game world is 5 meters tall
  public static final float VIEWPORT_HEIGHT = 5.0f;
  // GUI Width
  public static final float VIEWPORT_GUI_WIDTH = 800.0f;
  // GUI Height
  public static final float VIEWPORT_GUI_HEIGHT = 480.0f; // Location of description file for texture atlas public static final String TEXTURE_ATLAS_OBJECTS = "images/canyonbunny.pack"; // ...

Get Learning LibGDX Game Development - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.