Hi,
I've created a rough version of a plugin integrating Brian Grinstead's JS A* implementation. (see: https://github.com/bgrins/javascript-astar)
Repo is here: https://github.com/swmuron/melonjs-astar
Spaghetti code warning. I hacked this together one day while experimenting with Melon. I have a list of improvements in mind for it: you can see some of them on the project's README.
Right now it's creating its own set of nodes for searching. Ideally I'd like to attach its information to tiles directly instead of generating N x M new objects for each level. It's not a huge concern unless you're using huge levels or memory is a concern (e.g. mobile).
It also currently requires the 4 cartesian coordinates to perform the search with. Future improvements might be allowing a Rect, a Vector, or an Entity to be passed to it instead.
Aside from the above issues, I'm also a bit unsure of what the intended layout of a plugin should be like. The plugin code lies in a closure, but all the plugin code on the base class is doing is initializing my own AStarInstance class from the file's closure into `me.astar`. This is because the subscribe callback uses window as its scope and I can't access the plugin object directly. I won't necessarily know what name the user is going to give it, right? Maybe I'm just being a dumb JS newbie but is there a cleaner way of doing it besides the way I did it? (If you dig through the code manually, everything not-A*-related is line 321 and below.)
Relatedly, I think there would be value in a plugin tutorial. I really like the engine, especially how well it works with Tiled and that it has plugin functionality. I might be up to write one myself once I find out if I'm doing things "the proper way." Will also poke around the MelonJS repo itself and see if there's any small tasks I can do.
Cheers,
Sean