I'm sorry if the title confused you. This is the first time I'm posting here, forgive me if I have mistakes.
Here's what I'm trying to do:
I'm trying to assign multiple variables to a single value;
Health, stamina and magicka variables are in a file called globals.py, you can see it clearly. And my globals.py file is as following;
mage = "Mage" is my value here. This will not be changed. However, since health, stamina, and mana are variables, and the player will drain those attributes, these will change throughout the game. So I'm trying to assign different stat pools to different roles.
I don't get an error. When I print the role, health, stamina and magicka, the output is this;
All help is greatly appreciated. Thanks so much in advance!
Here's what I'm trying to do:
I'm trying to assign multiple variables to a single value;
1 2 3 4 5 6 7 |
from globals import health from globals import stamina from globals import magicka assassin = "Assassin" ; health + = 100 ; stamina + = 140 ; magicka + = 60 mage = "Mage" ; health + = 80 ; stamina + = 60 ; magicka + = 160 warrior = "Warrior" ; health + = 140 ; stamina + = 120 ; magicka + = 40 |
1 2 3 4 |
gold = 0 health = 0 stamina = 0 mana = 0 |
I don't get an error. When I print the role, health, stamina and magicka, the output is this;
Output:Mage 320 320 260
These are the output values I keep getting. Doesn't matter what role I choose. The only thing changing is the role. I keep getting the same/similar health, stamina and magicka values. I don't know how can I assign multiple variables to a single value. I'm still learning Python and I'm coding a simple text RPG while learning to keep my interest at its peak levels. Sorry, it's currently 3 A.M here and I'm getting tired. I tried to roughly translate my original codes to English. So I simply rewrote the whole code. If you see any mistakes, there are none in my original files.All help is greatly appreciated. Thanks so much in advance!