To set up the layers, you need to add another method.
1. Add the method
CreateLayers
into thegame
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
Again, we have implemented a method to create all the layers we need in the game.