Chapter 9. The 2D Maps API

In this chapter, we will cover the following recipes:

  • Creating maps with Tiled and loading them into Libgdx
  • Adding and querying map metadata
  • Developing your own map loaders and renderers

Introduction

Most games lay a collection of levels in front of the player for him or her to beat them. The design of those levels is crucial for the final result to be an enjoyable and engaging experience. If they are not challenging enough or too frustrating, the player will just throw away the controller or the phone and move on to something else!

We will not discuss level design; there are great specialized sources out there such as The Art of Game Design. You can refer to http://artofgamedesign.com for more details.

One thing is sure, though; level design involves loads of iterations including prototype, test, tweak, rinse and repeat. This makes it extremely important to use level editors that integrate well with your system, in order to be able to reduce the time from saving a level to testing it in the game.

Libgdx features a fantastic maps API that abstracts level loading, querying, and rendering. The Tiled and tIDE map editors are supported out of the box, but you can very easily extend it to achieve integration with the editor of your choice.

This chapter will provide you with everything you need to know about the Libgdx maps API, so you can succeed at making truly awesome levels with a streamlined pipeline.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.182.62