Hello, while I have experience programming I have never created a game and I am not sure how to structure my code. After looking at some projects I am still not 100% sure what I am doing.
I would appreciate if some one could show me how to arrange a character class, game(world) class, and a weapons class.
In my opinion (I’m not an expert), I would HIGHLY suggest reading books on game programming, especially in python. They run you through the steps, and show you how to use your code to make games.
I for one used that method(along with my lecturer, who taught us very very very basic programming), and I THINK it worked out quite well.
That’s the definitive coding style document for Python.
Update: Slight caveat, that should be name, not just name. name is a built-in magic variable. It will be “main” if the module is being run itself, otherwise it will contain the module name where it is being imported from.
hobbit: that line is part of pythons standard magic, if you have a py file and do python yourpyfile.py it will execute the following code, if you import yourpyfile as a module it will not. this is sometimes usefull to make modules which provide stand-alone functionality