Im trying to make a game and use the chronometer as a timer for each level. Not sure what I'm missing but I'm not sure how to check to chronometer's time.
This is the last code I tried
Not sure if it's the Chron code or the Level_Define routine thats not working.
:BangHead:
This is the last code I tried
B4X:
Sub Chrono_Tick
If Not(Resuming) Then
secs = Chrono.Text.SubString(Chrono.Text.Length - 1)
If secs = "30" Then 'supposed to stop timer then check score but just keeps running
Level_Define
End If
End If
Level_Define
End Sub
Sub Level_Define
Dim x As Int
Dim iScore As Int
Dim iLevelAdvance() As Int
iLevelAdvance = Array As Int ("20","40","60","80") 'array of points needed for each level
iScore = lblCurrentScore.Text 'checks the score
x = iLevelAdvance(Main.Level) 'sets level to match points needed
If iScore >= x Then 'suppose to check if user's score is enough for next level
Main.Level = Main.Level + 1 'changes level
StartActivity(LevelAdvance) 'activity that shows score and next level
Else
Player_Lose 'game over
End If
End Sub
Not sure if it's the Chron code or the Level_Define routine thats not working.
:BangHead: