Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from
Jan 18, 2017

Conversation

ootsby
Copy link
Contributor

@ootsby ootsby commented Jan 17, 2017

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.

Split out pathfinder and map to separate files.
implemented run/pause, step and restart buttons.
Moved search state information output to a text draw rather than html insertions.
Fixed bug where the visual heuristic wasn't being run for 4-way movement.
Added printing of open node info on mouseover.
# Conflicts:
#	spot.js
corrected mistake in node info printing.
@shiffman
Copy link
Member

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

@ootsby
Copy link
Contributor Author

ootsby commented Jan 17, 2017

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
Copy link
Contributor Author

ootsby commented Jan 18, 2017

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 shiffman merged commit 1308bf3 into CodingTrain:master Jan 18, 2017
@shiffman
Copy link
Member

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
Copy link
Contributor Author

ootsby commented Jan 18, 2017

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
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants