Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

4. Game #3, CometCrusher > Time for action — creating some layers

Time for action — creating some layers

We can use the following steps to create some layers:

  1. Add a new method called CreateLayers to the game class.
    Method CreateLayers:Int()
    
  2. Create the layers in the order they have to be rendered later on.
    layerBackGround = eng.CreateLayer()
    layerGame = eng.CreateLayer()
    layerFX = eng.CreateLayer()
    layerUI = eng.CreateLayer()
    layerTitle = eng.CreateLayer()
    layerScore = eng.CreateLayer()
    
  3. Close the method.
    Return 0
    End
    

Let them shine—the background stars

The stars are objects of the layerBackground layer.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint