![]() |
|
API >> Tutorials >> Tiles for games >> Non-uniform effect
How to give a non-uniform effect to a simple board?We use, in this example, the previous one, but we will modify a little the construction engine to break the uniformity of the board. We obtain this:
The principle is one more time very simple. Instead of one picture for tiles, we use 4 different images. There closely have the same representation, but the difference between them give this non-uniform effect:
The size of this images is always the same: 16x16.
Now in our engine, when we display a tile, we choose on of the four pictures for the sprite. To make the code easiest to use, we placed the four images in an array and we use the
In the next example, we will see how to generate a complete board with animations.
API >> Tutorials >> Tiles for games >> non-uniform effect
|