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.
CreateScoreScreen
to the game
class.Method CreateScoreScreen:Int()
eng.SetDefaultLayer(layerScore)
Local txtTitleHightScore:ftObject = eng.CreateText(font1,"H I G H S C O R E S",cw/2,70.0,1)
1
to 10
. This will be the factor that controls vertical placement of the list entries.For Local y:Int = 1 To 10
Local txtScoreNum:ftObject = eng.CreateText(font1,"#"+y,(cw/4.0)+50.0,80.0 + (ch/20.0)*y)
txtHighScore[y-1] = eng.CreateText(font1,"0000000",(cw/4.0)*3.0-50.0,80.0 + (ch/20.0)*y,2) Next
When the list is displayed, you want to provide a button for the user to use to go back to the menu.
btnBack
. Then, close the method.Local bt := CreateTextButton(font1, "Back", cw/2, ch-font1.Height(), btnBack, layerScore) Return 0 End
3.145.47.253