Reader small image

You're reading from  Corona SDK Mobile Game Development: Beginner's Guide

Product typeBook
Published inMar 2015
Publisher
ISBN-139781783559343
Edition1st Edition
Tools
Right arrow
Author (1)
Michelle M Fernandez
Michelle M Fernandez
Right arrow

Time for action – creating variables for the game


For any application to start, we'll need to create a main.lua file. This has been discussed in Chapter 2, Lua Crash Course and the Corona Framework, when we worked with some sample code and ran it with the simulator.

The code will be structured accordingly in your main.lua file by the time the game is completed:

  • Necessary classes (for example, physics or ui)

  • Variables and constants

  • Main function

  • Object methods

  • Call main function (this has to be called always, or your application will not run)

Arranging your code to make it look like the preceding structure is a good practice on keeping things organized and running your application efficiently.

In this section, we'll be introducing the display group that will show the main menu screen and a Play button that the user will be able to interact with in order to move on to the main game screen. All in-game elements such as the paddle, ball, brick objects, and heads-up display elements follow after the...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Corona SDK Mobile Game Development: Beginner's Guide
Published in: Mar 2015Publisher: ISBN-13: 9781783559343

Author (1)