Book Image

Corona SDK Mobile Game Development: Beginner's Guide

Book Image

Corona SDK Mobile Game Development: Beginner's Guide

Overview of this book

Corona SDK is the fastest and easiest way to create commercially successful cross platform mobile games. Just ask Robert Nay, a 14 year old who created Bubble Ball - downloaded three million times, famously knocking Angry Birds off the top spot. You don't need to be a programming veteran to create games using Corona. Corona SDK is the number one tool for creating fun, simple blockbuster games. Assuming no experience at all with programming or game development you will learn the basic foundations of Lua and Corona right through to creating several monetized games deployable to Android and Apple stores. You will begin with a crash course in Lua, the programming language underpinning the Corona SDK tool. After downloading and installing Corona and writing some simple code you will dive straight into game development. You will start by creating a simple breakout game with controls optimized for mobile. You will build on this by creating two more games incorporating different features such as falling physics. The book ends with a tutorial on social network integration, implementing in app purchase and most important of all monetizing and shipping your game to the Android and App stores.
Table of Contents (18 chapters)
Corona SDK Mobile Game Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Time for action – viewing a sample project in the simulator


Let's take a look at the HelloPhysics sample project in the simulator:

  1. Click on Simulator in the Corona SDK window.

  2. In the Open dialog that appears, navigate to Applications/CoronaSDK/SampleCode/Physics/HelloPhysics (Mac) or C:\Program Files\Ansca\Corona SDK\Sample Code\Physics\HelloPhysics (Windows). On Mac, click Open and it will automatically open main.lua. On Windows, double-click on main.lua to open the file. The HelloPhysics application opens and runs in the Simulator.

What just happened?

Accessing the SDK through the Corona Terminal or Corona Simulator depends on your preference of action. Many Mac users prefer to use the Corona Terminal so they can track messages outputted in the terminal, especially for debugging purposes. When you launch the SDK through the Corona Simulator, the simulator will display, but not the terminal window. When Windows users launch the Corona Simulator, it will display both the simulator and terminal windows. This is nice to use when you want to play around with any of the example applications that are provided by Corona.

The main.lua file is a special filename that tells Corona where to start in a project folder. This file can also load other code files or other program resources such as sounds or graphics.

When you launch the HelloPhysics application in Corona, you will observe a box object fall from top of the screen in the simulator and collide with a ground object. The transition from launching the main.lua file to viewing the results in the simulator are almost immediate.

Have a go hero – use a different device shell

As you start getting familiar with the Corona Simulator, whether you're in Windows or Mac OSX, a default device is always used when you launch an application. Windows uses the Droid as the default device, while the Mac OS X uses the regular iPhone. Try launching the sample code on a different device shell to view the difference in screen resolution in all the devices the simulator has available.

When porting builds to more than one platform, you'll have to consider the variety of screen resolutions in both iOS and Android devices. A build is a compiled version of all your source code converted into one file. Having your game build configured for multiple platforms broadens the audience reach for your application.