For this, you need to add a method that will update the list and then show the layer.
1. Insert the method
ShowScore
into thegame
class.Method ShowScore:Int()
2. To load the high-score list, make a call to fantomEngine's
LoadHighScore
method.LoadHighScore()
3. Start a FOR loop ranging from
1
to the count of score list entries.For Local y:Int = 1 To eng.scoreList.Count()
4. Set the text for each index in the high-score text object array with the value of the high-score list entry. Then, close the FOR loop.
txtHighScore[y-1].SetText(eng.scoreList.GetValue(y)) Next
5. Set the game mode to
gmScore
and activate layers with it using ourActiveLayer
method. After this, close the method.gameMode = gmScore ActivateLayer(gameMode) Return 0 End