Comments (21)
Reading this blog: http://as.ynchrono.us/2007/12/filesystem-structure-of-python-project_21.html
This project structure comes out:
Project/
|-- bin/
| |-- project
|
|-- project/
| |-- test/
| | |-- init.py
| | |-- test_main.py
| |
| |-- init.py
| |-- main.py
|
|-- setup.py
|-- README
from minecraft.
So, no one?
from minecraft.
Guys, would you bother if I rearrange the project tree? I want to change ideas of implementation and insert some documentation.
from minecraft.
Fork it and go to town!
from minecraft.
You mean a real fork or a github fork (that I alredy did)?
from minecraft.
From the README:
I would like to see this project turn into an educational tool. Kids love Minecraft and Python is a great first language. This is a good opportunity to get children excited about programming.
So the goal of this project is to get kids excited about programming, not to have production level project organization. I think the changes your propose would make it easier for professional python programmers to install this package, but tougher for kids to grasp what is going on. For that reason I do not think the hierarchy should be changed.
from minecraft.
I see.
from minecraft.
So the whole project will stay in one file? Since we want it to be well documented, this will become a huge file…
from minecraft.
I already went through and documented every method and attribute. The file is still under 1000 lines.
from minecraft.
jminardi, but are you talking about formal documentation or that Python inside-the-code documentation using docstring? Because the code I merged 3 hours ago just have some comments.
Bertrand, I wanted to do this way:
NameOfProject
NameOfProject/bin/
NameOfProject/lib/
NameOfProject/docs/
NameOfProject/tests/
NameOfProject/NameOfProject/
NameOfProject/NameOfProject/logic/
NameOfProject/NameOfProject/logic/entities.py
NameOfProject/NameOfProject/logic/physics.py
NameOfProject/NameOfProject/presentation/
NameOfProject/NameOfProject/presentation/graphics.py
NameOfProject/NameOfProject/presentation/keyboard.py
NameOfProject/NameOfProject/presentation/mouse.py
and so on.
To me it's not that complicated. And is even better for begginners to understand.
from minecraft.
@embatbr I am talking about this recently merge PR: #35
I disagree however that your nested directory structure would be easier to beginners for understand.
from minecraft.
jminardi, and what about things like the definition of class Player be in the main.py? I guess it isn't helpful to teach. Because Player inherit from Entity, that is in another separated module (with only it's definition). The entity module looks more like a class file in Java.
from minecraft.
I am not sure what you are referring to when you say Player and Entity. In master there are only two classes: Model
and Window
from minecraft.
@embatbr Totally agree, all the beginners to whom I taught programming were discouraged when facing huge files. And these times are gone.
I don't know however if double "NameOfProject" is a good idea. This is useful in Django projects to override templates, but it should be avoided here.
I also dislike "bin", "lib", "logic", and "presentation". "bin" and lib are useless (no real binary and libs are installed via pip). "logic" and "presentation" should be more generic and revelant, like "engine" and "settings".
@jminardi 1000 lines isn't small, and this is just the beginning.
from minecraft.
Yeah, it's because I still don't think totally as a Python programmer. I learned to program with Java, back in 2005, and for many years used the "Java way of programming" even writing pure C code. As Python doesn't require a "file per class" as Java or .h files, we can make something more simple.
But still is good to make a "source" package, to separate from tests, doc and etc. I suggested have the same name of the root because I see it a lot in Python projects and is good to make a distribuition (just get a package named "game name") of the game itself. Also, for the other porpouse, the educational tool, the students can get the entirely project folder.
So, I suggest we at least separate the game code in a proper folder. And take the logic definition from main.py.
from minecraft.
jminardi, it's because fogleman's repository is old. I forked from boskee's repository, that has a lot of code. Check it out: https://github.com/boskee/Minecraft
[EDIT] many other people use boskee's repository as base, so if you clone his repository, you will see a limited world, with day and night and the simple inventory.
from minecraft.
Wooo, @boskee worked a lot!
from minecraft.
I still don't know why fogleman didn't merged.
from minecraft.
boskee's tree is the unofficial new master tree. =p
Another suggestion: use to branches. One for a stable version and another for development.
from minecraft.
I forked the project into another repository and I am replacing things rewriting code.
Now I am learning how to use the pyglet.
https://github.com/embatbr/Dollycraft
from minecraft.
Suggested tree is too complex.
from minecraft.
Related Issues (20)
- Formula used to get #Top?
- I want looked my skins HOT 2
- Cannot operate the game character correctly
- Sometimes the game becomes unresponsive HOT 1
- Very elegant project!
- Petition HOT 1
- FOLLOW pyglet 2.0 UPGRADE HOT 1
- How can pyglet cancel the function of pressing the esc key to exit HOT 2
- Salut HOT 2
- NameError: name 'GL_FOG' is not defined HOT 9
- pyglet.gl.lib.GLException: (0x500): Invalid enum. An unacceptable value is specified for an enumerated argument. HOT 1
- Sign in HOT 1
- Hj HOT 7
- error HOT 2
- does not work HOT 1
- Hy HOT 2
- How do I play it? HOT 1
- I ran into a problem while replacing the block file
- FileNotFoundError: [Errno 2] No such file or directory: 'texture.png'
- NameError: name 'GL_FOG' is not defined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minecraft.