Hexsides

Started by
3 comments, last by Nick_Gen 20 years, 7 months ago
Hello, I currently work on an map editor for my Wargame, all functions Work Fine , but I would like to now implement the management of Hexsides(for rivers, roads...) Somebody can help me? I search some code or tutorial. Thanks Nick
Nick ):
Advertisement
A hex sequence of images for tile-connecting structures like rivers and roads require 64 unique images (2 to the 6th power) for inland tiles, and 6 images for coastal tiles. It may not actually require 70 images, however, if you make clever use of reflected, mirrored, and rotated images, or are able to build the structures from components (which works well for roads, but not so well for rivers), in which case you will need as few as 3 images for hexes.

storing this information in a file on disk is simple: you use a single bit to indicate the presence of a road and a single bit to indicate the presence of a river. at load time, you calculate the image required for that tile based on the road or river flag for that tile and the tile of all of its neighbors. i typically assign bit 0 to the direction closest to north when moving clockwise, and bits 1,2,3,4 and 5 are in a clockwise direction around the hex.





Get off my lawn!

Thank you for your Help,
I seek the means of detecting when the mouse passes over the hexsides.
With a Mouse Map ?
Nick ):
Well I was going to link you to a 2 part series that TANSTAAFL did, but GameDev no longer seems to have those files. Go to the Articles section and click on Tile-Based Games. There are sure to be some good resources for you in there.
7|-|3 p057 @b0v3 i5 c3/^7i|=i3|) 1337!100|< |=0/^ j||3|/|7
you mean these?

http://www.gamedev.net/reference/articles/article747.asp

http://www.gamedev.net/reference/articles/article748.asp

Get off my lawn!

This topic is closed to new replies.

Advertisement