We can set up the high score as follows:
game
class, create a new method called CreateHighScoreList
.Method CreateHighScoreList:Int ()
layerScore
layer.Local txtTitleHightScore:ftObject = eng.CreateText(font1,"H I G H S C O R E S",eng.canvasWidth/2,70,1) txtTitleHightScore.SetLayer(layerScore)
For Local y:Int = 1 To 10
Local txtScoreNum:ftObject = eng.CreateText(font1,"#"+y,eng.canvasWidth/4+50,80 + (eng.canvasHeight/20)*y) txtScoreNum.SetLayer(layerScore)
txtHighScore
array, which we have created earlier in the Creating a data structure section.txtHighScore[y-1] = eng.CreateText(font1,"0000000",(eng.canvasWidth/4)*3-50,80 + (eng.canvasHeight/20)*y,2) txtHighScore[y-1].SetLayer(layerScore)
Next layerScore.SetActive(False) Return 0 End
This method is a good example where you use local objects which you will never access individually in the game and also the use of global objects. These global objects are required when you want to change them later on, and need direct access to them.
18.220.53.93