Back to Tools
Levels and maps

Red Blob Games: Hexagonal Grids

By Amit Patel / Red Blob Games

Interactive hex-grid coordinates, neighbors, distances and screen picking.

guide
A pointy-top hex cell at axial coordinate zero zero is surrounded by its six correctly labelled axial neighbors, with the cube constraint q plus r plus s equals zero.
Original hex-grid illustration. This is one consistent axial orientation; do not mix formulas from different layouts. Original explanatory artwork prepared for GameSlash with AI assistance. Documentation is the factual source only; no source imagery reused. Not an official screenshot or gameplay capture. Concept source

Use it for: Hex-based tactics and strategy boards.

Start: 1) Choose orientation and coordinates. 2) Implement neighbors and distance with axial/cube coordinates. 3) Add hex-to-pixel, pixel-to-hex and rounding.

A pointer inside an original hexagon flows through fractional-coordinate conversion and rounding to a chosen cell and its pixel center.
Original picking workflow, not an engine screenshot. Boundary ties need a consistent policy and obstacle-aware movement needs separate rules. Original explanatory artwork prepared for GameSlash with AI assistance. Documentation is the factual source only; no source imagery reused. Not an official screenshot or gameplay capture. Concept source

Try checking: Pick centers and all six edges; verify coordinate round trips and distinguish geometric range from obstacle-limited movement.

Limits: The main page uses pseudocode. Rendering, input and movement rules need integration. Keep flat-top and pointy-top formulas consistent.

Source: Author’s guide

View source