Book Image

Learning LibGDX Game Development- Second Edition

Book Image

Learning LibGDX Game Development- Second Edition

Overview of this book

Table of Contents (21 chapters)
Learning LibGDX Game Development Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Handling level data


It's now time to think about how we can handle level data to lay out our levels, put objects into them at certain positions, define a starting position, and so on. This usually implies a lot of work before visible results will appear because creating levels require some kind of a tool to create, modify, save, and load their level data. Furthermore, before we can even load or save levels, we will have to define an appropriate file format to describe the data of a level.

Luckily, there is an easy route as long as we keep our requirements simple enough. We will not have to build our own level editor. Instead, we will use a drawing program such as GNU Image Manipulation Program (GIMP) (http://www.gimp.org/) or Paint.NET (http://www.getpaint.net/) to draw an image, where each pixel's color represents an object that is still to be defined. The position of a pixel in this image will also represent the position in our game world. Job done! We just defined our level format in a...