Book Image

Mastering LibGDX Game Development

By : Patrick Hoey
Book Image

Mastering LibGDX Game Development

By: Patrick Hoey

Overview of this book

Table of Contents (18 chapters)
Mastering LibGDX Game Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing map management with spawn points and a portal system


The next class represented in our top-level class diagram is MapManager, which can be found at core/src/com/packtpub/libgdx/bludbourne/MapManager.java. This class has helper methods for loading the TiledMap maps, as well as methods for accessing the different MapLayer, and MapObject objects in the layers.

MapManager

A class diagram that outlines the different attributes and helper methods is represented by the following diagram (Figure 10):

Figure 10

The import classes are as follows:

package com.packtpub.libgdx.bludbourne;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.maps.MapLayer;
import com.badlogic.gdx.maps.MapObject;
import com.badlogic.gdx.maps.objects.RectangleMapObject;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.math.*;

import java.util.Hashtable;

We are going to be using TiledMap (TMX format) maps that will then be rendered to a Screen instance using the OrthogonalTiledMapRenderer class...