romlok / godot-gdhexgrid

A GDScript hexagonal grid implementation for Godot.
MIT License
195 stars 24 forks source link

Support for pointy-top layout #7

Open anissen opened 4 years ago

anissen commented 4 years ago

This is a great implementation of the hex grid library. I'm missing the layout option for pointy-topped hexagons however. I'm using this tileset which only has pointy-topped hexagons. The implementation could be made to take the layout orientation into account (see e.g. https://github.com/droxmusic/HexMap/blob/master/HexMap/HexMap.gd).

I hope you'll consider this addition or, alternatively, have some pointers on how to convert your library into using a pointy-topped layout. Thanks!

romlok commented 4 years ago

Hi, thanks, and sorry for the slow response. I've been out of the Godot-verse for a while.

The first way to implement point-top hexes that comes to mind is to use flat-top orientation, and simply rotate the camera! :laughing:

It would be nice to implement pointy-topped natively, but I'm concerned about how much more complicated (or duplicated) it would make the calculation code. I wonder how useful it would be just for HexGrid to be able to automatically convert godot<->grid coordinates in either flat or pointy mode. I can't promise any action toward this any time soon though.

anissen commented 4 years ago

Okay, thanks for taking the time to reply :)