Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am using the following code to handle xp 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 exp

What do I need to change to make this work?

share|improve this question
add comment

1 Answer

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)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.