Time for action — creating layers for the game

To set up the layers, you need to add another method.

  1. Add the method CreateLayers into the game class.
    Method CreateLayers:Int()
    
  2. Store the default layer in the layerBackground field.
    layerBackground = eng.GetDefaultLayer()
    
  3. Then, create new layers for all the ones we have defined in the data class.
    layerGame = eng.CreateLayer()
    layerGFX = eng.CreateLayer()
    layerGameOver = eng.CreateLayer()
    layerMenu = eng.CreateLayer()
    layerScore = eng.CreateLayer()
    layerTitle = eng.CreateLayer()
    
  4. Close the method.
    Return 0
    End
    

What just happened?

Again, we have implemented a method to create all the layers we need in the game.

Our beloved play field—the background screen

Now, we will define all the elements of the background screen.

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

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