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

Location of samples #40

Closed
hashbangstudio opened this issue Oct 2, 2014 · 8 comments
Closed

Location of samples #40

hashbangstudio opened this issue Oct 2, 2014 · 8 comments

Comments

@hashbangstudio
Copy link
Contributor

Separating out into separate issue from #10.

Question : Where should sample usage of the API be located?

Option 1: separate folder at top level of project

minecraft/
samples/
tests/

or Option 2 : within the minecraft folder

minecraft/samples
tests/

or something else?

A teacher/user of the API will want to get quick access to the samples to show how to use the different aspects of the API. Raspbian package in repo would be most common distribution method for most people I would have thought. An alternative might be like the PyGame stuff on the Pi where it is in the Raspbian image already?

@ghickman
Copy link
Member

ghickman commented Oct 2, 2014

I'm all for having a curated sub-package of samples/examples within the project itself.

I have two main reasons for including them:

  • We can make sure they work with tests as though they are a normal part of the codebase.
  • A teacher can visually show how to do something in-game, eg "watch me build a house, we're going to learn how to write the code to do this today"

@doismellburning
Copy link
Member

@ghickman++

@hashbangstudio
Copy link
Contributor Author

@ghickman 👍

Both good reasons for within the project itself.

@jonathanfine
Copy link
Contributor

@hashbangstudio

Do you have some samples you'd like to contribute? If so, I'm sure we'd like to see them. Perhaps you could, in your fork of the repository, put them where you think they should go.

@dbrgn
Copy link
Member

dbrgn commented Oct 2, 2014

I'd also vote for minecraft/samples.

@dbrgn dbrgn mentioned this issue Oct 2, 2014
@hashbangstudio
Copy link
Contributor Author

Have some samples/examples that show how to use the original API in Python 2, will tidy up, PEP8, make Python 2 and 3 etc and add over next few days when get time.

Will put in minecraft/samples

@jonathanfine
Copy link
Contributor

@hashbangstudio

Thank you. I look forward to seeing the examples.

@hashbangstudio
Copy link
Contributor Author

Have added some samples here:
https://github.com/hashbangstudio/py3minepi/tree/add-examples/mcpi/samples

The samples were initially used to teach programming using minecraft and the original api, hence the large number of comments. Works with old api and new api at this commit and covers most functions in the old API.

There are a couple of examples where commented out sections are there in preparation for block type and color/colour enums which might possibly be added.

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

No branches or pull requests

5 participants