Thanks to this post: Hexagonal tiles and finding their adjacent neighbours, I'm able to collect adjacent tiles to a given tile. But I'm pretty much stuck on an algorithm that gives me only a "ring" of tiles specified by an offset. The algorithm given in that Stack Overflow post doesn't exactly care about the order in which it collects the tiles.
I know that with every offset 6 tiles are added.
- Offset 1 gives you 6 tiles (the first adjacent tiles).
- Offset 2 gives you 12.
- Offset 3 gives you 18, etc.
There is a constant growth of 6 with each offset. So I assume there should be a rule which adapts to these offsets. I can't exactly figure this one out. Anyone?