Search |
||||
Triangular tile mapPosted by malenkov on February 25, 2009 at 4:00 AM PST
Recall from the previous post there are only three regular polygons that can be used as tiles. Let's have a look at triangles now. Such tiles are practically not used in games because there is no direct path on the map and the game unit should be turned at each tile. Besides, it is rather hard to place units within acute corners because a lot of free space is wasted. A triangular tile map can be easily converted from a square tile map transformed to a parallelogram:
Let me introduce several definitions to be used in further calculations:
Calculating the central point of a tile by its index
Calculating the index of a tile by a point inside
Calculating distance between two tiles
The following calculations should be made if one triangle is normal and another one is turned over:
Running the exampleThe following example shows an implementation of the triangular tiling map. Each tile contains information about its indices and a distance from the selected tile. The source code is available, though, it is not optimal. It is »
Related Topics >>
Games Comments
Comments are listed in date ascending order (oldest first)
|
||||
|
|