Question

Are there any concrete examples of code using hexagonal maps with cocos2d? Except of drawing them manually, of course. I have found out that Tiled map editor (java version) allows to create these maps. But how to work with such map? I also don't know how to prepare a image for drawing into a hexagonal cell

Was it helpful?

Solution

My current solution is to draw manually. But I have found an interesting way to store this field into an usual 2d array. For examle:

enter image description here

where circles are hexagons.

I can store this map as:

0 1 0
1 0 1
0 1 0
1 0 1
0 1 0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top