ippa/jaws — pull request #62 by MalphasWats (2013-01-02 16:42:13+00:00)
Title: Tests for TileMap.findPath() added, inverted feature added and a bit of tweaking

I've added some tests for the pathfinding code, it's the first time I've written a test, so they might not be very good. Happy for any feedback so I can make them better!

This time I ran the build.rb script, so everything should be updated properly (although it didn't create the docs because I don't have jsdoc (or access to the server ;)

I added an 'inverted' feature that forces findPath() to only look at nodes that **do** have something in as it gives more options for use. I also re-factored the part that adds nodes to the open list, including checking to see if you're trying to look outside of the tile map (which was missing before and never caused a problem because my example had a wall all around the outside).

Hopefully this all makes sense and is useful. (these are my first 2 pull requests, so apologies if I've made things difficult, I'm still learning!).

(one other note, the tests worked fine in Safari, but wouldn't work at all on Chrome, both my new tests and a whole load of the existing ones, I'm not sure why, possibly an issue with running it locally?).

Thanks.