I've been wrestling with this and decided to ask for assistance.
Scenario:
Tiles Width: 340 Height: 160
By definition, a hexagon has 6 equal sides. With the above dimensions that开发者_JS百科's no longer the case. It more resembles a diamond. Finding the coordinates for a traditional hexagon in cocos2d is easily located in a Google search. I can't figure out the equation I need to calculate tile coordinates in the irregular hexagon. When sketched on paper it's essentially two isosceles trapezoids. On the cocos2d forums I found someone else with the same problem [cocos2d post]: http://www.cocos2d-iphone.org/forum/topic/17253.
Can anyone offer a solution or guidance?
Isn't it enough to scale it? Use functions you found for equally sided hexagon, create grid with hexagon side 160 and scale grid on width by 340/160.
精彩评论