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 – loading an app on your Android device


There are several ways to load your Hello World build to your Android device that don't require you to download the Android SDK. Here are some simple methods:

The most fundamental method to upload an .apk file onto your device is to transfer it to the SD Card via the USB interface. If your device doesn't come with some kind of file manager application, a great one you can download from the Google Play Store is ASTRO File Manager at: https://play.google.com/store/apps/details?id=com.metago.astro. There are many other installers like AppInstaller at: https://play.google.com/store/apps/details?id=com.funtrigger.appinstaller. AppInstaller allows you to install .apk files from your SD card. You can always do a normal search for the preceding apps on the Google Play Store app on your device.

  1. Under your device's Settings, select Applications and then select Development. Tap on USB Debugging if the mode is not active.

  2. Go back a couple of screens to the Applications section. Enable Unknown Sources if it is not already active. This will allow you to install any non-market application (that is, debug builds). Select the home button on your device when done.

  3. Connect the device to your computer with a USB cable. You will see a new notification that a new drive has connected to your PC or Mac. Access the SD drive and create a new folder. Name the folder something that you can identify easily for your Android builds. Drag-and-drop your Hello World.apk file from the desktop to the folder.

  4. Eject the drive from your desktop and disconnect your device from the USB cable. Launch ASTRO File Manager or AppInstaller, whichever app you decided to download from the Google Play Store. In ASTRO, select File Manager, search for the folder you added on your SD card and select it. In AppInstaller, search for your newly named folder and select it. In both apps, you will see your Hello World.apk file. Select the file and a prompt will appear asking you to install it. Select the Install button and you should see your Hello World application appear in the Apps folder of your device.

    A convenient method is through Dropbox. You can create an account at: https://www.dropbox.com/. Dropbox is a free service that lets you upload/download your files on your PC/Mac and mobile devices.

  5. Download the Dropbox installer and install it on your computer. Also, download the mobile app from the Google Play Store (which is also free) on to your device and install it.

  6. Log in to your Dropbox account on your computer and mobile device. From your computer, upload your Hello World.apk file.

  7. Once it has finished uploading, go to the Dropbox app on your device and select your Hello World.apk file. You will be greeted with a screen that will ask you if you want to install the application. Select the Install button. Assuming that it installs correctly, another screen will appear saying Application installed and you can launch your Hello World app by pressing the Open button that is available.

    One of the easiest methods is through Gmail. If you don't already have a Gmail account, create one at: https://mail.google.com/.

  8. Log in to your account, compose a new e-mail and attach your Hello World.apk file to the message.

  9. Address the recipient of the message to your own e-mail address and send it.

  10. On your Android device, make sure you have your e-mail account linked on there as well. As soon as you receive the message, open the e-mail, and you will be given the option to install the application to your device. There will be an Install button or something similar displayed.

What just happened?

We just learned several ways on how to load a .apk file to an Android device. The preceding methods are some of the easiest ways to load an application quickly without running into any problems.

Using the file manager method allows you to access your .apk files easily without requiring any carrier data or Wi-Fi connection. By using a USB cable that is compatible with your device and connecting it to your computer, it's a simple drag-and-drop procedure.

The Dropbox method is the most convenient method of... once you have it set up on your computer and your mobile devices. All you have to do is drag-and-drop your .apk file to your account folder and it's instantly accessible to any device with the Dropbox app installed. You can also share your files through a download link—another great feature provided by Dropbox.

Setting up a Gmail account and sending your .apk files as attachments to yourself is a simple process if you don't want to download any file managers and other programs to your device and computer. The only thing you have to remember is that you can't e-mail an attachment over the size of 25 MB in Gmail.

Pop quiz – understanding Corona

  1. When using Corona, which of the following statements is true?

    a. You need a main.lua file to launch your application.

    b. Corona SDK only runs on Mac OSX.

    c. The Corona Terminal doesn't launch the simulator.

    d. None of the above.

  2. How many iOS devices can you use for development in the iPhone Developer Program?

    a. 50.

    b. 75.

    c. 5.

    d. 100.

  3. What does the Version Code have to be when building for Android in Corona SDK?

    a. A string.

    b. An integer.

    c. Has to follow the Java scheme format.

    d. None of the above.