tags:

views:

20

answers:

0

In a tile based game, how could a tile identified as just a "road tile" in an array determine what kind of road tile it should be (horizontal road, vertical road, left turn, etc)?

So, the array that describes the map would be like this:

alt text

There are generic grass tiles and generic road tiles. However, when the map is actually rendered following a tilemap, it needs to be able to determine what kind of road tiles to draw in order for it to look like a normal road. I think it would be something like iterating through each array element and checking each adjacent element to determine how to draw the original element, but I haven't figured out a good mathematical way of checking.