Python Forum
Py3 Data Resource file help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Py3 Data Resource file help (/thread-10437.html)



Py3 Data Resource file help - esteel - May-20-2018

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