I'm currently making an RPG style game using the python tkinter libraries. I'm trying to work on battle system however I am running into issues with the damaging system
I'm trying to change the variables given into the function as arguments but of course I can't do that.. I've tried looking at other solutions and they simply wouldn't help due to the fact that tkinter works differently to other code.
Here is my code:
def Attack(EnemyHP,EnMax,GuiEnemyHP,EnemyHPBar,Width):
Dmg = AtkDmg()
EnemyHP = EnemyHP - Dmg
GuiEnemyHP['text'] = Enemy + ": " + str(EnemyHP)+ '/' + str(EnMax)
Loss = (Width / EnMax) * Dmg
Width = EnemyBar_Width - Loss
EnemyBar.place(x=110,y=0,width=Width,height=20)
returnthe variables and assign them back to the originals outside your function