r/madeinpython • • Sep 23 '20

Another Python Text RPG!

I have been learning Python for about 5/6 months now and decided to make a text RPG to practice my OOP knowledge that I’ve learned from various tutorials on YouTube and Udemy.

Any feedback on my code and/or the mechanics of the game would be greatly appreciated.

I’m also hoping for my next project to covert this to have a GUI, I have heard of a few modules such as PyQt5, PyAutoGUI, Tkinter and I’m sure there are others, but I’m not really sure which one would be best to learn for a Text RPG, so any recommendations on that would be great as well.

GitHub link:

GitHub

Google drive installer link(you don't need python or dependencies for this one):

Google Drive

19 Upvotes

9 comments sorted by

View all comments

4

u/duquesne419 Sep 23 '20 edited Sep 23 '20

Just cloned the repo. You might consider adding a requirements.txt. I installed colored per your readme, but when I ran main.py I errored for not having winsound installed. If you develop in pipenv you can do pip freeze > requirements.txtand then not have to worry about any overlooked modules, python will include any used in the project.

edit: after a little reading it seems winsound might be standard on pc, so requirements.txt wouldn't have solved the issue for me on mac.

3

u/Sithrar Sep 23 '20

Ah yea I didn't think of that, as I tested and created this on Win10.

I'll add a note about winsound being used.

Did you find if there's anyway around this issue or would it only work on windows?

3

u/duquesne419 Sep 23 '20

A quick google suggests there's not an easy converter you can add to existing code. It looks like you would either need to do a second version specific to mac(and possibly a 3rd for linux). Or you could rewrite your current code with a module like pyaudio. I just found that while googling though, so I don't know anything about it's implementation.

2

u/Sithrar Sep 23 '20

Interesting, I'll have to have a look at pyaudio and see if would be easy to switch in place of using winsound.

Also there's a lot of os.system('cls') usage in the code so it wouldn't be compatible with mac/linux for that reason too, but I could easily change that at some point.