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 – 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...