Python GUI Questions
3 04 Feb 2016 18:21 by u/Marsog
Hi,
Recently I've gotten into python and I'm having fun putting together small things such as text based games. My dream has always been to make something like Dwarf Fortress or Aurora 4x and I believe that python is the way to go for me. I have a little programming experience with the Unity game engine and C#.
----------
I have a few questions for you all if you don't mind:
1. How would I go about making an interface like Aurora 4x? Basically its a bunch of buttons, tables, and windows that all tie into one main system. The platform for this game is going to be windows if that helps at all. A simple google image search for "Aurora 4x" will show you what I mean.
2. Is there any easy to use database system for python? In my game I believe that the best way to store the information for the game will be in a database, which will allow me to create saves and allow players to transfer their saves by simply moving the database file. I'm new to databases so sorry if that doesn't really make sense.
3. Is there a way to have multiple .py files "talk" to each other? In Unity for example you would have multiple C# files which could all handle different aspects of the game, so you could potentially have an "playerInventory.cs" and a "playerGUI.cs" which would both handle different aspects of the GUI for the player.
Thanks for the help!
4 comments
1 u/monetus 07 Jun 2016 14:31
I've been learning tcl/tk, which has python bindings and works on every OS. Might be an easy way to control some things laid over open gl. but good luck man.
0 u/NervousHorse 05 Feb 2016 09:19
With one of these GUI frameworks. I would probably use PyGame and build the GUI elements myself.
I don't know, there might be. Or you could just use text files if you don't mind them being readable by the player.
I believe you would import all the scripts in your main file (for example
import playerInventory) and then use their functions likeplayerInventory.someFunction(). Unity has the main game loop hidden from you, but it basically calls all the update functions you have in individual scripts every frame and then renders the results.0 u/forgetmyname 05 Feb 2016 09:28
this game is written in VB 6.0, an "ancient" language, which gives it the particularly old look.
An "easy" way can only come with experience. Having none, your best place to start is finding how to connect sqlite to python
python can manipulate files by default with several methods. For example. file()