O'Reilly logo

Corona SDK Mobile Game Development by Michelle M. Fernandez

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 – adding a main menu

We're going to create the frontend of our game by introducing the game title, Play button, and Options button that will transition throughout different scenes in the application with ease.

  1. Create a new file called mainmenu.lua and import Storyboard and UI modules, the storyboard.newScene() function, and the variables for timer and audio.
    local storyboard = require( "storyboard" )
    local scene = storyboard.newScene()
    
    local ui = require("ui")
    
    local btnAnim
    
    local btnSound = audio.loadSound( "btnSound.wav" )
  2. Create the createScene() event. Add in the line, storyboard.removeScene( "maingame" ) and storyboard.removeScene( "options" ), which will remove the "maingame" and "options" scene. Removing "maingame" will occur ...

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