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 – printing values using blocks


Let's give it a shot and see how powerful a language Lua is. We're starting to get an idea of how variables work and what happens when you assign values to them. What if you have a variable that has multiple values attached to it? How does Lua differentiate them? We'll use the Corona terminal so that we can see the values outputted in the terminal box. Along the way, you'll pick up other programming techniques as you progress through this section. We will also refer to chunks in this exercise. The unit of execution in Lua is called a chunk. A chunk is a block that is executed sequentially. Follow these steps on getting started with Lua:

If you remember, in the previous chapter, you learned how to create your own project folder and main.lua file for the Hello World application.

  1. Create a new project folder on your desktop and name it Variables.

  2. Open up your preferred text editor and save it as main.lua in your Variables project folder.

  3. Create the...