To set up the layers for the game, we will use a method inside the game class, as follows:
At first, add a new method header called CreateLayers.
Method CreateLayers:Int()
Create a new layer for the game objects and store it inside layerGame.
layerGame = eng.CreateLayer()
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.
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.