I am very inspired by the fact that the post above has received so many likes. So I decided to continue developing this template and add new mechanics to it.
So, let's say we want to create a turn-based game. Let's add numerical a variable "MP" (movement points) to the unit and set its value to 3. This way, the unit can move 3 hexes in one turn.
Now let's add new types of hexes: forest and mountains. Let's make it so that a unit can move through all hexes, but each hex will have a different movement cost. For example, the "forest" hexes has a cost of 4 points, the "mountain" costs 6 points, and the regular hexes costs 3 points. Also, we'll set the unit's movement points to 9. And the "water" hexes will remain impassable for the unit.
Now let's add a line to indicate the movement boundary for the unit. It's very simple to do this. We need to check the values of neighboring cells in the array, and if the value of a neighboring cell is greater then the unit's movement points, then we set a boundary line between two hexes.
Like this post if you like my template. Perhaps I will continue to develop this example and add new mechanics to it ;)
Try on Arcade
Download this template