Introduction

Writing mobile apps is hard. Writing mobile games is even more so.

Why is that? Well, there are probably lots of reasons I could state, but one jumps to the forefront almost immediately: variety. The variety of platforms available today is staggering when you consider developing an application that runs everywhere. From iOS to Android, from BlackBerry to Windows Mobile, not to mention a number of lesser platforms, there are lots of places your app could run.

Even if you simply concern yourself with the two market-share leaders, iOS and Android, it’s still a daunting task to develop for both. Sure, you could always develop two versions of the same application targeted for each platform, and plenty of times that’s exactly what is done. That approach, however, has the significant downside of requiring substantially different skill sets and tools, which means you generally need two sets of developers to maintain two completely (or nearly completely, anyway) code bases.

You can, of course, go with a web-based approach and let HTML, JavaScript, and CSS be the common platform you develop to. While that works in many cases, for things like games it tends not to work as well. You’re giving up much of the capabilities, power, and performance of the native platforms in that model, something most developers would prefer not to do. It’s a trade-off to consider, though: maintaining a single, potentially less feature-rich and performant code base versus maintaining multiple “ideal” code bases.

Thankfully, there’s another option. There are a number of cross-platform tools that let you develop a single code base that can run on multiple platforms while still maintaining most, if not all, of the native capabilities you’d have if you’d done true native development.

Of them, the Corona SDK is one of the best.

In this book, we’ll explore the Corona SDK together, see what it has to offer, and learn how to use it to develop high-performance applications that can run equally well on iOS and Android. We’ll focus our attention on game development, since that’s what Corona is focused on. However, we’ll also see how it’s not exclusively for that—you can in fact develop any type of application you want with Corona!

The Book: An Overview

We’ll break up the experience over the course of 11 chapters in which we’ll build a game, Astro Rescue, that will demonstrate a significant chunk of Corona functionality. The contents of those 11 chapters will break down thusly:

  1. What is Corona? Why use it? The functionality it provides, how to get it, licensing and a first small example running in the simulator on your desktop PC.
  2. The basics of Lua, the language that underpins Corona.
  3. The overall structure of a typical Corona game, including things like code modules, the Storyboard API, basic event processing, object-oriented game design, program flow, and configuration files.
  4. Getting started with graphics. Getting things on the screen, moving them around, memory management, transitions, UI widgets, and more.
  5. The core Astro Rescue game code. We’ll get deeper into graphics, get going with some audio, and of course the underlying logic behind the game. Things like the main loop, core events, and the beginning of input handling. We’ll get into sprites and animation in more depth and get a first look at physics.
  6. Deeper into the core game code we go! We’ll walk through the main loop in detail and look closer at graphics, transitions and animation, drawing techniques, and so on.
  7. Various forms of input events such as touch, accelerometer, and gyroscope control will be looked at here.
  8. Collision events, a core concept of most games. Here we’ll also get into some “special effects” like masking and gradients.
  9. We’ll complete walking through the game code here and finish up any odds and ends that remain to be seen.
  10. Some advanced topics such as ads, SQLite, in-app purchases, and game network integration.
  11. How to take the now-completed Astro Rescue project and build it for Android and iOS devices, how to get it onto those devices, and test and debugging techniques. We’ll also look at the app store models available to us and how to get your app published in them.

By the end, you’ll have a solid foundation on which to build. you’ll have a good picture of what Corona provides and a better understanding of how to put it to good use. You’ll be able to quickly and easily create the next great Angry Birds–level hit, at which point I hope you remember your favorite author.image

Saving Your Fingers

Are you the sort that likes to type in every bit of code you see in a book? If so, have at it and enjoy!

For the rest of us, you can obtain the source code for this book by visiting www.apress.com/source-code and save yourself a lot of time and energy.

Perfection Is Relative

This book is certified 100% flawless.

Not a single mistake will be found anywhere within it.

On the off chance that proves to not be entirely accurate, errata will be posted on the Apress web site.

But, as I said, its not a real concern anyway.

;)

If You Want to Yap at Me

Have a comment to fire at me? A compliment to pay? A complaint to lodge? I’m all ears—virtually of course! Feel free to fling e-mails my way at [email protected]. I’m also on “the Twitter” at the not very creative username of @fzammetti.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.140.18