Time for action — creating layers for the game

To set up the layers for the game, we will use a method inside the game class, as follows:

  1. At first, add a new method header called CreateLayers.
    Method CreateLayers:Int()
    
  2. Create a new layer for the game objects and store it inside layerGame.
    layerGame = eng.CreateLayer()
    
  3. The top row of the game will hold some text objects. As the play field would cover them a little bit, we will move the game layer a little bit downwards.
    layerGame.SetPos((eng.canvasWidth-11*64)/2+32,+100)
    
  4. Now, create another layer for the title screen and store it inside layerTitle. After that, close this method.
    layerTitle = eng.CreateLayer()
    Return 0
    End
    

What just happened?

This time, we only created layers for the game objects and the title screen. For the text info objects, we will use the default layer of fantomEngine.

The second-most important part—a title screen

The title screen in At The Blocks will be a simple one. Of course, you can use images as a title screen and menu screen, but we are keeping it simple here.

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

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