Book Image

Python Game Programming By Example

Book Image

Python Game Programming By Example

Overview of this book

Table of Contents (14 chapters)
Python Game Programming By Example
About the Authors
About the Reviewers

Tile maps

The technique of tile maps became a successful approach to storing large amounts of information about game worlds with small, reusable pieces of graphics. In 2D games, tile maps are represented by a two-dimensional matrix that references to a tile object. This object contains the required data about each cell of the terrain.

The initial sheet used by the tile map contains the "building blocks" of our scenario, and it looks like what is shown in the following screenshot:

Starting from this simple image, we can build a grid map in which each cell is one of the squares the sheet is divided into.

Tiled Map Editor

We will use Tiled Map Editor, a useful tool for manipulating tiled maps. It can be downloaded for free from, and it can be run on most operating systems, including Windows and Mac OS.

This software is also well-suited for level design, since you can edit and visualize the resulting world in a simple way.

Once we have installed and launched the program,...