Hellenic / react-hexgrid

Build interactive hexagon grids with React
https://hellenic.github.io/react-hexgrid/examples/
MIT License
318 stars 130 forks source link

Path route conditions #26

Closed thirdman closed 5 years ago

thirdman commented 5 years ago

Hi. I'm enjoying this project!

Is there any easy/obvious approach towards making a path avoid some hexes? The use case for me is the idea of 'impassable' tiles...

screen shot

(I want my Mongolian Horde to not be able to go over Mt Everest!)

Note: I recognise this is a side project, so I understand if you don't want to/have time to respond. 😀 It's not a big issue for me, just something I was wondering about.

Hellenic commented 5 years ago

Hey! Glad you've found this useful. That would be pretty neat feature but currently there's nothing for that. Easiest way to do something like that would be probably to write your own version of Path component: https://github.com/Hellenic/react-hexgrid/blob/master/src/Path.js

thirdman commented 5 years ago

I thought as much. Thanks!