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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.