CodingTrain / AStar

AStar example with community contributions
117 stars 66 forks source link

Added basic GUI controls with stepping, restart, diagonals option. Node info. Refactoring. #9

Closed ootsby closed 7 years ago

ootsby commented 7 years ago

I don't know if you'd rather take this easy merge and make #4 more difficult or go in order and bounce this back to resolve conflicts after that one. I'm easy either way.

shiffman commented 7 years ago

Ooops, I ended up going in order and merged #4. Can you refactor this?

ootsby commented 7 years ago

Yeah, I'll get onto it later this evening. Early stage changes to this sort of quick and dirty code are always going to end up with breaking merges.

ootsby commented 7 years ago

Okay, done. I think the rendering stuff needs pulling out of Spot and put into a MapRenderer or similar but this will do for now before more pull requests pile up.

shiffman commented 7 years ago

This is great, thank you! I think it might be a nice improvement to change the code to use p5.dom.js for the interface elements. See #13. I also noticed there are some issues with maybe stroke around the buttons and text now that some of the map rendering has changed.

ootsby commented 7 years ago

Sure. I'd have no major objections to replacing the UI. The reasons I just hacked together some UI code are just:

  1. I've no idea what UI libs are around or which you'd prefer.
  2. I think it's generally better for teaching examples to be self-contained both for understanding and to be easier to get up and running.
shiffman commented 7 years ago

Thanks! Yes, p5.dom.js is a library I teach with that goes well with the main p5.js canvas rendering so it's a great choice for here. Thanks for getting this started!