Time for action — creating layers for the game

Just as in the previous chapter, we will add a method called CreateLayers:

  1. Add a method called CreateLayers into the game class.
    Method CreateLayers:Int()
    
  2. Create new layers for the background, the game, and the title screen.
    layerBackGround = eng.CreateLayer()
    layerGame = eng.CreateLayer()
    layerTitle = eng.CreateLayer()
    
  3. Close the method.
    Return 0
    End
    

What just happened?

We want to group (layer) the game into three sections—one for the background, one for the actual game, and one for the title screen. Therefore, we have created the CreateLayers method.

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

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