Time for action — saving the high score list

  1. Create a new method called SaveHighScore.
    Method SaveHighScore:Int ()
    
  2. Use the SaveToString method of the engine's scoreList to save it to a string.
    Local hs:String = g.eng.scoreList.SaveToString()
    
  3. Save this string with a call to SaveState. Then close this method.
    SaveState(hs)
    Return 0
    End
    

What just happened?

By creating more specialized help methods, we can easily plug them into the game where we need them. Also, we have avoided creating redundant code, which means we don't have duplicate code sections in the game.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.105.114