- Edited
Hi all, I'm making a small little roguelite where the player upgrades stats with cards. Thing is, I don't know how to make this code... good? I'm using an export variable to determine what variable of the players the card will change, but I can't just go "player.stat += change" The only way I can is with this kind of code, shortened to make is bearable.
Thanks in advance.
match stat:
"speed":
player.speed += change
"reload":
player.reloadSpeed -= change
"shotSpeed":
player.attackSpeed -= change
"exp":
player.expMult += change
...