I made a hexagonal grid, I did!

That is a screenshot of a 100×100 grid of hexagons.

The hex system is handled as a 2D vector of Hexagon objects in a Board class that keeps track of them all. Each hexagon has its own location that gets calculated based on its index in the 2D vector (thanks to some math from this smart dude). Each hexagon also has an array of 6 pointers that point to whichever hexagon is adjacent to each of its 6 edges. Border edges are represented by NULL, and more code will be needed to keep our (eventual) characters from falling off the edges of the world. The framework is there though!

The Board has a node in the scene graph and each hexagon has a node that is a child of the Board node.

Here is screenshot of my beautiful hexagon placeholder.

### Like this:

Like Loading...

*Related*