Geners
Member
I have a hex grid and I used http://3dmdesign.com/development/hexmap-coordinates-the-easy-way this guide to figure out how distance works on such a grid.
I made my grid, gave every hex a coordinate, and then checked the distance of each hex tile with the tile at 2,3
Most of the grid shows the correct distance but some show bizarre or impossible distances. Here is a screenshot. The top number on each tile is the coordinate, the bottom is the distance.
What am I doing wrong here?
I made my grid, gave every hex a coordinate, and then checked the distance of each hex tile with the tile at 2,3
GML:
var xDif = coordinate[0] - 2;
var yDif = coordinate[1] - 3;
var twoDif = yDif - xDif;
var distance = max(xDif,yDif,twoDif);
draw_set_font(f_hex);
draw_text(x,y + 12,string(distance));
Most of the grid shows the correct distance but some show bizarre or impossible distances. Here is a screenshot. The top number on each tile is the coordinate, the bottom is the distance.
What am I doing wrong here?