Time for action — creating layers for the game

We will create these layers inside their own CreateLayers method. Follow these steps:

  1. Insert a new method called CreateLayers inside the game class.
    Method CreateLayers:Int()
    
  2. Now, create a new layer for the background, the game itself, and the title screen.
    layerBackGround = eng.CreateLayer()
    layerGame = eng.CreateLayer()
    layerTitle = eng.CreateLayer()
    
  3. Close the method.
    Return 0
    End
    

What just happened?

We have added a method to create new layers. These layers help us with updating and rendering the game in an organized fashion.

Our beloved play field—the background screen

This time, we will compose the background layer. It will be drawn as the background for the actual gameplay.

Buttons—I need more text buttons!

To create text buttons, we will add our own method for it. It will automatically set up a text object that is able to be hit-tested against touches and/or mouse clicks.

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

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