qiao / PathFinding.js

A comprehensive path-finding library for grid based games
http://qiao.github.io/PathFinding.js/visual/
8.42k stars 1.32k forks source link

Hexagonal grids #135

Open KaitaniLabs opened 8 years ago

KaitaniLabs commented 8 years ago

I can't find any mention of hexagonal grids in the docs or issues. Is it possible?

brean commented 6 years ago

Sure, all you need is another neighbor function (that does not give the top/right/bottom/left cell but instead the top/top-right/bottom-right/bottom/bottom-left/top-left ones).