We will build the functionality to update text info into a method that will update not only the time left, but also the game's score value.
UpdateInfoText
in the game
class.Method UpdateInfoText:Int()
txtScore
with the score value.txtScore.SetText(score)
750
(to make it more accurate), and then dividing everything by 1000
, to get seconds.seconds = (endTime-Millisecs()+750)/1000
seconds
.minutes = seconds/60
seconds -= (minutes*60)
txtTime
.If seconds > 9 Then txtTime.SetText(minutes+":"+seconds) Else txtTime.SetText(minutes+":0"+seconds) Endif
Return 0 End End
The method UpdateInfoText
will update the game's score text object and also calculate the time left in minutes and seconds. During the game, the updated info text objects will look like this: