So, I’m making an RPG and I’m wondering, should I have lot of separate scripts and reference them as I need it or is there a better way? So like my Level up script:
private int experienceToNextLevel = 20;
public int currentExperience = 0;
public int attackPower;
public int defencePower;
public int HP;
public int Level;
// Use this for initialization
// Update is called once per frame
void Update () {
if (currentExperience == experienceToNextLevel) {
Level++;
attackPower *= 2;
defencePower *= 2;
HP *= 2;
experienceToNextLevel *= 3;
Debug.Log (experienceToNextLevel);
}
}
And then I’m wondering how to implement my Attacking script. Should I reference this script every time the player attacks to see how much damage the player gives based on his current level or should I work the attacking logic here so I don’t have to keep grabing these varibles into another script.
Sorry if that sounds confusing and thanks in advance =)