Python Forum

Full Version: Py3 Data Resource file help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all, I’m creating a little game as part of a learning exercise. I’m not using any game-oriented libraries nor do I want to, this is to help me learn/understand core(or at least close to it) python. Basically what I’m trying to do is create a separate resource file that defines all of the game’s weapons and weapon’s attributes in a separate file that I can call on when needed. I’m having a hard time figuring it out. Should it be a module that can be imported? Or is there a better file type/way? I’ve been messing around with the module idea and trying to define each item separately as a function but I don’t think I’m fully understanding. Just for an example let’s say I wanted a weapon to be named “Wooden Axe” with a damage of 1 and size (defining inventory space elsewhere) of 5. Any help is appreciated