Work out how far apart two hexagon squares are and which ones a blast covers
On a map of hexagons, measuring distance with the usual row and column numbers gives wrong answers, and a blast of radius two covers the wrong squares or too few. Here is the coordinate trick that makes distance, rings and blast areas simple and correct.
Why this works
Hexagon rows are shifted against each other, which breaks the usual idea of distance by rows and columns. A coordinate system where all six neighbours look alike makes distance and blasts a matter of simple counting; convert only at the edges where you draw or store.
When not to use it
Needless on a map of squares, where plain row and column maths already works. And if hexagons are only decoration and units move freely between them, you do not need any of it. Do not mix the two coordinate kinds in the same place.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 25 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Work out how far apart two hexagon squares are and which ones a blast covers" (read_entry hex-grid-blast-area-and-distance) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP