Closed harshavb closed 3 years ago
Creating via HexagonGroup.cs
Hexagons should be laid out as such.
I've realized that there are many instances where we want consistent hexagon sizes among differently sized hexagon groups. So, there should be a variable hexagonSize
and HexagonSize
which determine the size of the overall hexagon group based on the value of the variable. If no value is given for HexagonSize
, then the total hexagon group will be sized base on Size
alone, with all hexagons fitting inside.
Note that regarding the coordinate system, we should consider one that uses constant basis vectors so that we don't need to use if(mod(x, 2) == 1) position.y -= hexagon.height
to correct the offset of the hexagons bumping up and down
Makes sense, switching to that layout instead.
The actual grid:
Many elements of the game, such as the board, segments of the board, and the local game options background, require a set of hexagons which are connected to each other, with any given hexagon having 0-6 other hexagons connected. Ideally, we want to implement this with optional spacing between the hexagons. Each hexagon group should be a container, so that it's easily rotatable and scalable. The coordinates of each hexagon should be determined solely from the position, rotation, scale, and spacing of the hexagon group. Current idea is to create a coordinate grid based on those variables, and then assign hexagons to the grid as needed. It could be helpful to have a Vector2 offset as well to position the grid offset from the position of the hexagon group itself.