Book Image

Libgdx Cross-platform Game Development Cookbook

Book Image

Libgdx Cross-platform Game Development Cookbook

Overview of this book

Table of Contents (20 chapters)
Libgdx Cross-platform Game Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating maps with Tiled and loading them into Libgdx


During our first contact with the Libgdx maps API, we will create a simple level with the Tiled map editor, load it into our game, and render it as part of our game loop. Tiled is a very popular, cross-platform, freely available, open source tile-based editor.

Note

Tile-based maps are levels made out of small texture blocks called tiles. Combining tiles from a reduced set, complex and interesting results can be achieved while saving texture memory.

There is not much you need to know to start working with Tiled maps in your game. You will soon realize how extremely simple the process is, as Libgdx, very kindly, does all the hard work for you!

Getting ready

Download and install the latest version of Tiled for your operating system from http://www.mapeditor.org/download.html.

We are going to use the Base tileset pack created by Kenney and available under the Creative Commons Zero license at http://www.kenney.nl/assets.

Make sure the samples projects...