Day 5 Game 5: 30 games in 30 days using Grids
This is what Grids did for us today. What can Grids do for you?
Game 5 is a version of the game Lines played on a Cairo pentagon grid. In this version you have to match four cells in a hexagon instead of lines. hint: the hexagons can be pointy or flat. 😉
Cairo grids are unusual: each cell has 5 neighbors; however, there is no five-fold symmetry. There are no straight lines (at least not in the same sense as in regular grids). The overlapping patterns of hexagons are exploited for a neat implementation – under the hood the Cairo grid is simply a spliced pointy-hex grid. We also use these patterns in the gameplay for this game to group four dots in a neat pattern.
The implementation of this Unity game is straight forward. We use the A star path finding algorithm of the library to make sure moves are legal, and then to animate the point along the path. Because Cairo grids have no straight lines, the movement is more dynamic (erratic) than it would be on any of the regular grids in the plugin.