my current code for my character lvling system is very basic
public float Xp = 0f; //floats can be used for later lvls so gathering xp takes longer
public float Health = 100f;
public int Level = 1; // i believe it makes since to start off as one instead of zero
public float XpToNxtLvl = 0f;
public int FibonacciLevel = 0;
XpGain(float amount )
{
Xp += amount;
if( Xp >= XpToNxtLvl)
{
NextLvl();
}
}
NextLvl()
{
XpToNxtLvl += 1100;
Health += 50;
}
new formula
fn = fn-1 + fn-2
would i make n (Level+1) and f (XpToNxtLvl) is it that easy?
(FibonacciLevel+1))-1 + (FibonacciLevel+1))-2
old formula
XpToNxtLvl += ((XpToNxtLvl * (Level + 1)) - 1 + (XpToNxtLvl * (Level + 1)) - 2);
my Answer
XpGain(float Fibonacci)
{
Xp += Fibonacci;
if( Xp >= XpToNxtLvl)
{
NextLvl();
}
}
NextLvl()
{
FibonacciLevel = Level +1;
XpToNxtLvl += ((FibonacciLevel-1) + (FibonacciLevel-2))
Health += 50;
Level += 1;
}
I believe there could be some mistakes which is why I’m posting this question
thank you for your time reading this sorry if its long i appreciate any feedback
theres another post about an infinte lvl system
http://answers.unity3d.com/questions/973992/infinite-level-system.html
who makes use of a private multiplier variable would it make since to turn the fibonacci formula instead into a private variable?
the basic code is from a couple of rpg tutorial series i was using to learn from so since it not my own other than variable changes ill just say i got it from the HardlyBriefProgramming series as well as naman jain both on youtube.