Time for action — creating a StartNewGame method

This method will deactivate the title layer, set the level number to 1, and load the level. To implement it, follow the ensuing steps:

  1. Insert the new method called StartNewGame into the game class.
    Method StartNewGame:Int()
    
  2. Deactivate the title layer.
    layerTitle.SetActive(False)
    
  3. Set the level number to 1 and load the level.
    levelNum = 1
    LoadLevel()
    
  4. The field gameMode needs to be set to gmPlay. Close this method.
    gameMode = gmPlay
    Return 0
    End
    

What just happened?

Our last helper method starts a new game. It set all corresponding fields and will load the first level map.

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

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