1. Insert a new method called
UpdateInfoText
.Method UpdateInfoText:Int()
2. Set the text field of the text objects with their corresponding values.
txtScore.SetText("Score: "+score) txtComets.SetText("Comets: "+cometCount) txtLevel.SetText("Level: "+levelNumber) txtLifes.SetText("Lifes: "+lifes)
3. Close the method.
Return 0 End
Within the UpdateInfoText
method, we update all of our UI text objects so they display the current values regarding score, the level number, how many lives are left, and also how many comets are left on the screen.