O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required