Re: Straight vs. Diagonal
The biggest problem in coding a hexgrid that I remember was defining a coordinate system and calculating whether two hexes are adjacent. On a square grid, that's trivial: you know that square (x,y) touches square (x+1,y). On a hex grid, hex (x+1, y) still touches hex (x,y), but so does either hex (x+1,y+1) or hex (x+1,y-1), depending on whether x is odd or even. Calculating the range between two hexes is even worse.
We did this for a college programming project course, and I remember that our group and one of the other Groups came up with totally different systems to resolve this.
------------------
Cap'n Q
The most merciful thing in the world, I think, is the inability of the
human mind to correlate all of its contents. We live on a placid
island of ignorance in the midst of black seas of infinity, and it was
not meant that we should go far. -- HP Lovecraft, "The Call of Cthulhu"
__________________
Cap'n Q
"Good morning, Pooh Bear," said Eeyore gloomily. "If it is a good morning," he said. "Which I doubt," said he.
|