Time for action – adding the new main.lua file

While using Composer, our main.lua file is still vital since it is the first thing that Corona SDK looks at to launch an application in the simulator. We're going to add some lines of code that will change scenes for our game:

  1. Create a brand new file called main.lua and let's add it back in our status bar:
    display.setStatusBar( display.HiddenStatusBar )
  2. Import Composer and load the first scene called loadmainmenu. We will create this scene in the next couple of sections:
    -- require controller module
    local composer = require ( "composer" )
    
    -- load first screen
    composer.gotoScene( "loadmainmenu" )

In order to incorporate Composer throughout the application, we called the local composer = require ( "composer" ) module. The scene will be changed with composer.gotoScene( "loadmainmenu" ), which is a loading screen directing the user to the main menu screen.