To display the values of the highest scores, we will utilize the CreateHighScoreList
method from Chapter 4, Game #3, CometCrusher, and make a few changes to it.
1. For this, add a method called
CreateScoreScreen
to thegame
class.Method CreateScoreScreen:Int()
2. Set the score layer as the default layer.
eng.SetDefaultLayer(layerScore)
3. Create a local text object to display the headline.
Local txtTitleHightScore:ftObject = eng.CreateText(font1,"H I G H S C O R E S",cw/2,70.0,1)
4. Start a FOR loop ranging from
1
to10
. This will be the factor that controls vertical placement of the list entries.For Local y:Int = 1 To 10
5. Next, create a local text object that will display the entry number.
Local txtScoreNum:ftObject = eng.CreateText(font1,"#"+y,(cw/4.0)+50.0,80.0 + (ch/20.0)*y)
6. To display each entry of the list, create text objects that will be stored inside the text array we have defined at the beginning. Then close the FOR loop.
txtHighScore...