GithubHelp home page GithubHelp logo

Comments (21)

embatbr avatar embatbr commented on July 30, 2024

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.

embatbr avatar embatbr commented on July 30, 2024

So, no one?

from minecraft.

embatbr avatar embatbr commented on July 30, 2024

Guys, would you bother if I rearrange the project tree? I want to change ideas of implementation and insert some documentation.

from minecraft.

joshuaskelly avatar joshuaskelly commented on July 30, 2024

Fork it and go to town!

from minecraft.

embatbr avatar embatbr commented on July 30, 2024

You mean a real fork or a github fork (that I alredy did)?

from minecraft.

jminardi avatar jminardi commented on July 30, 2024

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.

embatbr avatar embatbr commented on July 30, 2024

I see.

from minecraft.

BertrandBordage avatar BertrandBordage commented on July 30, 2024

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.

jminardi avatar jminardi commented on July 30, 2024

I already went through and documented every method and attribute. The file is still under 1000 lines.

from minecraft.

embatbr avatar embatbr commented on July 30, 2024

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.

jminardi avatar jminardi commented on July 30, 2024

@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.

embatbr avatar embatbr commented on July 30, 2024

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.

jminardi avatar jminardi commented on July 30, 2024

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.

BertrandBordage avatar BertrandBordage commented on July 30, 2024

@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.

embatbr avatar embatbr commented on July 30, 2024

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.

embatbr avatar embatbr commented on July 30, 2024

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.

BertrandBordage avatar BertrandBordage commented on July 30, 2024

Wooo, @boskee worked a lot!

from minecraft.

embatbr avatar embatbr commented on July 30, 2024

I still don't know why fogleman didn't merged.

from minecraft.

embatbr avatar embatbr commented on July 30, 2024

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.

embatbr avatar embatbr commented on July 30, 2024

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.

fogleman avatar fogleman commented on July 30, 2024

Suggested tree is too complex.

from minecraft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.