Cover by Michelle M. Fernandez

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Time for action – creating variables for the game

For any application to start we'll need to make a main.lua file. This has been discussed in the previous chapter when we worked with some sample code and ran it with the simulator.

The code will be structured accordingly in your main.lua 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 always has to be called or your application will not run)

Formatting your code to make it look like the preceding structure is 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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required