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 — showing the menu

The menu screen is shown using the following steps:

  1. Add the method ShowMenu into the game class.
    Method ShowMenu:Int()
    
  2. Set the game mode to gmMenu and activate layers with it. Then, close the method.
    gameMode = gmMenu
    ActivateLayer(gameMode)
    Return 0
    End
    

What just happened?

We created a simple method to display the menu layer.

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