How to implement BFS for hexagon field (in javascript)
<p>I work on a hexagon map based browser game. I have this: <a href="http://www.dark-project.cz/wesnoth/map-view/1" rel="nofollow">http://www.dark-project.cz/wesnoth/map-view/1</a> and now I have a problem I want to mark the fields at which the unit can go (it has limited movement). 
If the movement is 1 there isn't any problem but if it's higher it doesn't work right (try it).</p>

<p>I work with a coordinates system <a href="http://www.dark-project.cz/wesnoth/coor.png" rel="nofollow">http://www.dark-project.cz/wesnoth/coor.png</a></p>

<p>My actual js is here: <a href="http://www.dark-project.cz/wesnoth/js/map/base.js" rel="nofollow">http://www.dark-project.cz/wesnoth/js/map/base.js</a></p>

<p>In other question ( <a href="http://stackoverflow.com/questions/6813526/movement-algorithm-on-a-hexagon-map">Movement algorithm on a hexagon map</a>) @unkulunkulu recommend me to use the BFS algorithm. But I have no experience with algorythms like this and its implementing into javascript and then its use on hexagon map. He say that the BFS algorithm is better for that because I can easy expand it later (add some obstacles etc.).</p>

<p>If you have some link to a javascript tutorial about this or something similar it will be amazing.</p>
