O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing the tile map

The most prominent part of Treasure Chest is the tile map. In the game, the map is build out of an array that stores the type of gem and image objects that represent the visible part of the game. For sure, it could be handled differently, but we will take this route for now.

Getting tile map slot IDs

Let's start with two methods that will determine the slot positions of a corresponding gem image object. Remember, its position has to be divided by its width to get the slot position.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required