Generic, allocation-conscious and tested to 100% coverage, with results that stay bit-identical across amd64 and arm64.
One map of walls, rough ground, a scout and a goal, drawn by each library in turn: as shapes, as hexes, and as grids of every layout. Each library builds on the one before it.
Immutable 2D geometry: points, vectors and shapes with their tests, casts and constructions.
Hexagonal grid math: coordinates, rings, lines, line of sight and field of view.
2D grids with rectangular, isometric and hexagonal layouts, range and sight queries, and pathfinding, on geometry, hexagon and container.
- container: generic containers, a table of values per index and an immutable sorted set, on geometry.
- spatial: broad-phase spatial indexes, a spatial hash with box, point and cast queries and touching pairs, on geometry.
- assert: lightweight test assertions.
- errors: a drop-in superset of
errorswith fields, stack traces and multi-errors.
Each post on the blog takes one decision from these libraries and shows the code and the numbers behind it.
- Go libraries for 2D games: geometry, hexagon and grid (2026-11-06): the three libraries on one map.
Bug reports and proposals are welcome in each library's issues. Please see Contributing before opening a pull request, and Security to report a vulnerability.
Every library is released under the MIT License, in the LICENSE.md of its repository.