I'm a beginner in VB.NET and I'm creating a simple simulation game, have hunger, thirst etc, in progressbar hunger the maximum that arrives is 100.
When you eat something restores 5, if I'm 98 and how it gives error.
I would like to know if you have any code to specify that the maximum that can reach is 100 and not to pass it
Like for example being 98 hungry and instead of going to 103 go to 100, only restoring 2.
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
ProgressBar2.Value = Fome
Module Module1
Public Fome As Integer = 100