Book Image

Corona SDK Mobile Game Development: Beginner's Guide

By : Michelle M Fernandez
Book Image

Corona SDK Mobile Game Development: Beginner's Guide

By: Michelle M Fernandez

Overview of this book

Table of Contents (19 chapters)
Corona SDK Mobile Game Development Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – adding the loading screen


We'll place loading screens when the application launches and before the game level starts. This tells the user that more content or information is on its way.

  1. Create a new file called loadmainmenu.lua in your project folder.

  2. Import Composer and add in the composer.newScene() function:

    local composer = require( "composer" )
    local scene = composer.newScene()
  3. Create two local variables called myTimer and loadingImage. Add in the create() event and a sceneGroup display group:

    local myTimer
    local loadingImage
    
    -- Called when the scene's view does not exist:
    function scene:create( event )
      local sceneGroup = self.view
    
      print( "\nloadmainmenu: create event" )
    end
  4. Create the show() event and add in a sceneGroup display group:

      -- Called immediately after scene has moved onscreen:
    function scene:show( event )
      local sceneGroup = self.view
    
      print( "loadmainmenu: show event" )
  5. Introduce the loadingImage display object:

      loadingImage = display.newImageRect...