Hex-Maps, my dreaded enemy!
Just finished working on a hex-map engine for a potential project. So far it can display a tile-based hex-map, allow it to scroll and let mouse select do its magic.Greatest help ever came from this particular tutorial, which is not only useful for determining the particular tile a mouse is selecting, but also to know which tiles to draw in the window (so you don't draw the whole thing every time, even though a minimum amount of tiles are visible.)
![]() |
| The grid is alive! |
That's a small look at it so far, in all its programmer-graphics glory. That green tile with the white boundary is the currently selected tile (by mouse). That test map is 50 by 50 tiles, but only those on (or near) the screen get called to be drawn, and the map can scroll across the screen seamlessly.
Word of Advice:
Always, always, always verify that whatever it is you believe to be a hexagon actually is one. The shapes that Power Point or Paint produce by default (as in: keeping the aspect ration given by default) are not real hexagons: real hexagons have sides which are all the same side, whereas those had different lengths per side.
Trust me, lost quite a bit of time on that one.
Next up: trying to set up so the tiles themselves animate, and maybe some unit work.
