I'm having some trouble figuring this out. I have a while statement with an expression that should be evaluated on each loop. I feel like I am thinking about this wrong.
What I'm trying to do is loop through the expression experience >= experienceCap until it is false. The experienceCap is set correctly on each loop, but the while expression values never change even though the values actually do change on each loop.
public void refreshExperience() {
int experience = getExperience(); //10
int experienceCap = getExperienceCap(); //100
while (experience >= experienceCap) {
newExperienceCap();
refreshExperience();
}
}
This results in some log output like:
experience: 10
experienceCap: 100
experience: 10
experienceCap: 450
experience: 10
experienceCap: 1120
experience: 10
experienceCap: 2337
And an inevitable crash. I would very much appreciate any input, thank you!
newExperienceCap()