1

I am using the following code to handle experience points gains:

reqXP = (Level ^ 2 + Level + 3) * 4

    If (currXP >= reqXP) Then

        Level = Level + 1
        expPoints = expPoints + 3

        excessXP = currXP - reqXP

        currXP = excessXP

        excessXP = 0

    End If

lbl_XP.Text = "Experience : " & currXP & " / " & reqXP

However, whenever I level up, it won't update the reqExp Label until I get my next batch of experience points.

What do I need to change to make this work?

Vaillancourt
  • 16,325
  • 17
  • 55
  • 61
Gutanoth
  • 119
  • 2

1 Answers1

2

Just add the "reqXP = (Level ^ 2 + Level + 3) * 4" if the player levels up. Actually you should only calculate it once the player levels up and keep the variable instead of calculating it every frame (if that's what you are doing)

AB.
  • 406
  • 3
  • 7