8
\$\begingroup\$

It would represent a map that is semi-square of arbitrary size. It would have a simple system for representation of the map coordinates, such as 0101 (first column, 1st hex). I'd want the map to be able to tell me the distance between two points and what other hexes lay between those two points, as a list or array.

I don't care as much about the language, but C# or Python would be ideal.

Does one exist?

\$\endgroup\$

closed as off-topic by Sean Middleditch, bummzack, MichaelHouse Aug 26 '13 at 14:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are about "which tech to use" are outside the scope of the site. For more information, see this meta post" – Sean Middleditch, bummzack, MichaelHouse
If this question can be reworded to fit the rules in the help center, please edit the question.

4
\$\begingroup\$

Not a library but more of a tutorial. Looking though the tutorial it seems to do everything you requested. It uses C# / XNA.

http://www.sgtconker.com/2009/12/article-hexagonal-coordinates/

Edit: Link is dead so see the WaybackMachine

\$\endgroup\$
  • \$\begingroup\$ The version of that code in jemginehex.codeplex.com includes a variety with the other alignment. [Seeing my own article pop up as an answer is nice.] \$\endgroup\$ – Blecki Dec 24 '11 at 13:11
4
\$\begingroup\$

The Cocos 2D library has support for rendering hex tile maps. I have not used it, but the library has been around for years and seems quite popular.

That might be more for rendering than for doing calculations on the hex map though. Fortunately what you ask for is quite simple to implement anyway, especially if you use a good x/y coordinate system for your hexes. See: http://www-cs-students.stanford.edu/~amitp/gameprog.html#hex

\$\endgroup\$
3
\$\begingroup\$

I believe the Java version of the Tiled Map Editor supports hexagonal maps. Have a look for yourself at: http://www.mapeditor.org/

\$\endgroup\$
3
\$\begingroup\$

Pieter Geerkens (who is here on stackexchange) has a C# library for hexagons.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.