Corona SDK Mobile Game Development: Beginner's Guide


Corona SDK Mobile Game Development: Beginner's Guide
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
$25.49
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
$49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Build once and deploy your games to both iOS and Android
  • Create commercially successful games by applying several monetization techniques and tools
  • Create three fun games and integrate them with social networks such as Twitter and Facebook

Book Details

Language : English
Paperback : 408 pages [ 235mm x 191mm ]
Release Date : April 2012
ISBN : 1849691886
ISBN 13 : 9781849691888
Author(s) : Michelle M. Fernandez
Topics and Technologies : All Books, Mobile Application Development, iOS, Mobile, Beginner's Guides

Table of Contents

Preface
Chapter 1: Getting Started With Corona SDK
Chapter 2: Lua Crash Course and the Corona Framework
Chapter 3: Building our First Game: Breakout
Chapter 4: Game Controls
Chapter 5: Animating our Game
Chapter 6: Playing Sounds and Music
Chapter 7: Physics: Falling Objects
Chapter 8: Operation Storyboard
Chapter 9: Handling Multiple Devices and Networking your Apps
Chapter 10: Optimizing, Testing, and Shipping your Games
Chapter 11: Implementing In-App Purchases
Pop Quiz Answers
Index
  • Chapter 1: Getting Started With Corona SDK
    • Downloading and installing Corona
    • Time for action – setting up and activating Corona on Mac OS X
    • Time for action – setting up and activating Corona on Windows
    • Using the simulator on Mac and Windows
    • Time for action – viewing a sample project in the simulator
    • Choosing a text editor
    • Developing on devices
    • Time for action – downloading and installing Xcode
    • Time for action – creating a Hello World application in two lines of code
    • Time for action – modifying our application
    • Time for action – applying a new font name to your application
    • Testing our application on an iOS device
    • Time for action – obtaining the iOS developer certificate
      • Adding iOS devices
        • Xcode
        • iTunes
    • Time for action – adding/registering your iOS device
    • Time for action – creating an App ID
      • Provisioning Profiles
    • Time for action – creating a Provisioning Profile
      • Application icon
    • Creating the Hello World build for iOS
    • Time for action – creating an iOS build
    • Time for action – loading an app on your iOS device
    • Testing our application on an Android device
    • Creating the Hello World build for Android
    • Time for action – creating an Android build
    • Time for action – loading an app on your Android device
    • Summary
    • Chapter 2: Lua Crash Course and the Corona Framework
      • Lua to the rescue
      • Valuable variables
        • Global variables
        • Local variables
        • Table fields (properties)
        • Assignment conventions
      • Types of values
      • Time for action – printing values using blocks
      • Expressions
        • Arithmetic operators
        • Relational operators
        • Logical operators
        • Concatenation
        • Length operator
        • Precedence
      • Strings
        • Quoting strings
      • Time for action – getting our hands full of strings
      • Tables
        • Passing a table as an array
        • Altering contents in a table
        • Populating a table
      • Objects
        • Display objects
        • Display properties
        • Object methods
      • Images
        • Loading an image
        • Image autoscaling
      • Time for action – placing images on screen
      • Runtime configuration
        • Dynamic content scaling
        • Dynamic content alignment
        • Dynamic image resolution
        • Frame rate control and anti-aliasing
      • Time for action – scaling display objects on multiple devices
        • Dynamic resolution images
      • Time for some shapes
        • Applying stroke width, fill color, and stroke color
        • Text, text, text
        • Applying color and string value
      • Functions
        • Defining a function
        • More display functions
        • Content size properties
      • Optimizing your workflow
        • Using memory efficiently
        • Optimizing your display images
      • Summary
      • Chapter 3: Building our First Game: Breakout
        • Breakout—bringing back old-school gaming
        • Understanding Corona physics API
          • Setting up the physics world
            • Starting, pausing, and stopping physics
            • physics.setGravity
            • physics.getGravity
            • Tilt-based gravity
            • physics.setScale
            • physics.setDrawMode
            • physics.setPositionIterations
            • physics.setVelocityIterations
        • Configuring the application
          • Build configuration
        • Time for action – adding build.settings file
          • Runtime configuration
        • Time for action – adding config.lua file
        • Building the application
          • Displaying groups
            • display.newGroup()
          • Working with system functions
            • system.getInfo()
            • system.setAccelerometerInterval()
        • Time for action – creating variables for the game
        • Understanding events and listeners
          • Register events
          • Runtime events
            • enterFrame
            • accelerometer
          • Touch events
            • touch (single touch)
            • tap
        • Transitions
        • Creating menu screens
        • Time for action – adding the main menu screen
        • Creating the gameplay scene
        • Time for action – adding game objects
        • Time for action – building bricks
        • Red alert!
        • Time for action – displaying game messages
        • Summary
        • Chapter 4: Game Controls
          • Moving in the up direction
          • Let's get even more physical
            • physics.addBody()
          • Time for action – starting physics for the paddle and ball
          • Paddle movement
          • Time for action – dragging the paddle in the simulator
          • Time for action – moving the paddle with accelerometer
          • Ball collision with paddle
          • Time for action – making the ball bounce against the paddle
          • Removing objects from the scene
            • Variable references
          • Brick by brick
          • Time for action – removing the bricks
          • Directional changes
          • Time for action – updating the ball
          • Transitioning levels
          • Time for action – resetting and changing levels
          • You win some, you lose some
          • Time for action – making win and lose conditions
          • Activating event listeners
            • Collision events
              • Global collision listeners
              • Local collision listeners
          • Time for action – adding game listeners
          • The results are in!
          • Summary
          • Chapter 5: Animating our Game
            • Panda star catcher
            • Let's get everything moving
              • Transitions
              • Easing
            • The value of timed functions
              • Timers
            • Movieclips or sprite sheets. What's the difference?
            • Movieclips
              • Movieclip functions
            • It's sprite mania!
              • Sprite API
            • Game time!
            • Time for action – setting up the variables
            • Let's start the round
            • Time for action – starting the game
            • Poof begone!
            • Time for action – reloading the panda on the stage
            • Earn some points
            • Time for action – tracking the score
            • When the game ends
            • Time for action – displaying the game over screen
            • Background display
            • Time for action – adding the background elements
            • Heads up!
            • Time for action – displaying the timer and score
            • Time after time
            • Time for action – setting up the timer
            • It's so glowy
            • Time for action – making the power shot
            • Pandas!
            • Time for action – creating the panda character
            • Starry skies
            • Time for action – creating star collisions
            • Screen touches
            • Time for action – launching the panda
            • Organizing display objects
            • Time for action – reordering layers
            • Create stars
            • Time for action – creating stars in the level
            • Starting the game
            • Time for action – initializing the game
            • Summary
            • Chapter 6: Playing Sounds and Music
              • Corona Audio System
                • Sound formats
                • Sound filename limitations on Android
                • Mono sounds at their best
                • Maximum number of simultaneous channels
              • Time to play
                • audio.loadSound()
                • audio.loadStream()
                • audio.play()
                • Looping
                • Simultaneous playback
              • Time for action – playing audio
              • Time to take control
                • audio.stop()
                • audio.pause()
                • audio.resume()
                • audio.rewind()
              • Time for action – controlling audio
              • Memory management
                • audio.dispose()
              • Alterations to audio
                • Volume control
                  • audio.setVolume()
                  • audio.setMinVolume()
                  • audio.setMaxVolume()
                  • audio.getVolume()
                  • audio.getMinVolume()
                  • audio.getMaxVolume()
                • Fading audio
                  • audio.fade()
                  • audio.fadeOut()
              • Performance tips
                • Pre-loading phase
                • audioPlayFrequency
                • Patents and royalties
              • Summary
              • Chapter 7: Physics: Falling Objects
                • Creating our new game: Egg Drop
                  • Starting variables
                • Time for action – setting up the variables
                  • Controlling the main character
                • Time for action – moving the character
                  • Updating the score
                • Time for action – setting the score
                  • Displaying the environment
                • Time for action – drawing the background
                  • Displaying the heads-up display
                • Time for action – designing the HUD
                  • Creating the game lives
                • Time for action – counting the lives
                  • Introducing the main character
                    • Complex body construction
                • Time for action – creating the character
                  • Adding post-collisions
                    • Collision handling
                  • Body properties
                    • body.isAwake
                    • body.isBodyActive
                    • body.isBullet
                    • body.isSensor
                    • body.isSleepingAllowed
                    • body.isFixedRotation
                    • body.angularVelocity
                    • body.linearDamping
                    • body.angularDamping
                    • body.bodyType
                • Time for action – creating the egg collision
                  • Making the display objects fall
                • Time for action – adding the egg object
                • Time for action – making the egg drop
                  • Ending the gameplay
                • Time for action – calling game over
                  • Starting the game
                • Time for action – activating the game
                • Summary
                • Chapter 8: Operation Storyboard
                  • Continuation of Egg Drop
                  • Data saving
                    • BeebeGames Class for saving and loading values
                    • Getting paths to files
                    • Reading files
                    • Writing files
                  • Time for action – saving and loading the high score
                  • Pausing the game
                  • Time for action – pausing the game
                  • Storyboard API
                    • Game development with Storyboard API
                  • Time for action – altering the game file
                  • Organizing the game
                  • Time for action – adding the new main.lua file
                  • New game transitions
                  • Time for action – changing screens after the game is over
                  • Creating a loading screen
                  • Time for action – adding the loading screen
                  • Creating a main menu
                  • Time for action – adding a main menu
                  • Creating an options menu
                  • Time for action – adding an options menu
                  • Creating a credits screen
                  • Time for action – adding a credits screen
                  • Summary
                  • Chapter 9: Handling Multiple Devices and Networking your Apps
                    • Return to configuration
                      • Build configuration
                        • Orientation support (iOS)
                        • Orientation support (Android)
                        • Version code and version name (Android)
                        • Application permissions (Android)
                      • Content scaling on an easier level
                        • The best of both worlds
                      • The deeper meaning of dynamic image resolutions
                      • High-resolution sprite sheets
                    • Networking your apps
                      • Posting to Twitter
                    • Time for action – adding Twitter in your apps
                      • Posting to Facebook
                    • Time for action – adding Facebook to your apps
                    • Facebook Connect
                    • Time for action – posting scores using Facebook Connect
                    • The wonders of OpenFeint
                      • Game network API
                        • gameNetwork.init()
                        • gameNetwork.show()
                        • gameNetwork.request()
                    • OpenFeint in a jiffy
                    • Time for action – setting up OpenFeint leaderboards and achievements in Egg Drop
                    • Summary
                    • Chapter 10: Optimizing, Testing, and Shipping your Games
                      • Understanding memory efficiency
                        • Graphics
                          • Group objects
                          • Turn off animations when they're not being used
                          • Optimizing image sizes
                      • Distributing iOS applications
                        • Prepping your app icons
                      • Time for action – setting up your distribution certificate and provisioning profile for the App Store
                      • iTunes Connect
                        • Contracts, tax, and banking
                      • Time for action – managing your application in iTunes Connect
                      • Building an iOS application for distribution in Corona
                      • Time for action – building your application and uploading to Application Loader
                      • The Google Play Store
                        • Creating launcher icons
                      • Time for action – signing your app for the Google Play Store
                      • Time for action – submitting an app to the Google Play Store
                      • Summary
                      • Chapter 11: Implementing In-App Purchases
                        • The wonders of In-App Purchase
                          • Types of In-App Purchases
                        • Corona's store module
                          • store.init()
                            • event.transaction
                          • store.loadProducts()
                            • event.products
                            • event.invalidProducts
                          • store.canMakePurchases
                          • store.purchase()
                          • store.finishTransaction()
                          • store.restore()
                        • Create an In-App Purchase
                        • Time for action – creating the In-App Purchase in iTunes Connect
                        • Time for action – using the Corona store module to create an In-App Purchase
                        • Testing In-App Purchases
                          • User test accounts
                        • Time for action – testing the In-App Purchase with the Breakout In-App Purchase demo
                        • Summary

                        Michelle M. Fernandez

                        Michelle M. Fernandez is a mobile game developer for iOS/Android devices and co-founder of MobiDojo (http://www.mobidojo.com). She is also a mentor for aspiring artists and programmers trying to break into the game industry. After experimenting with several game engines over the years, she was introduced to Corona SDK in late 2010 and has been an avid user of the program ever since. She enjoys creating tutorials and new game frameworks for others to learn from. When Michelle is not developing games, she is spending time with friends and family, playing video games, basketball, singing, or baking delicious pastries.
                        Sorry, we don't have any reviews for this title yet.

                        Code Downloads

                        Download the code and support files for this book.


                        Submit Errata

                        Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                        Errata

                        - 6 submitted: last submission 11 Mar 2013

                        Errata type: Code | Page number: 61 | Errata date: 09 May 12

                        At line 3 of the code, on the bottom of the page. It says new entry, with key "b". It should be, new entry, with key "y"

                         

                        Errata type: Typo | Page number: 114

                        The last sentence of the 3rd paragraph is repeated.

                         

                        Errata type: Typo | Page number: 110

                        if event.other.name == "brick" and ball.x + ball.width * 0.5 event.

                        should be:

                        if event.other.name == "brick" and ball.x + ball.width * 0.5 < event.

                        Errata Type: Typo | Page number: 148

                        Options for the question 2 should be:

                        a. physics.addBody( ball, { density=2.0, friction=0.5,bounce=0.2, radius = 25 } )

                        b. physics.addBody( ball, "dynamic", { density=2.0,friction=0.5, bounce=0.2, radius = 15 } )

                        Errata Type: Typo | Page number: 52

                        which and are listed under Assignment conventions are not keywords.

                        Errata Type: Typo | Page number: 55

                        Under What just happened?, 2nd paragrapgh, 1st line

                        where i equals 1

                        should be:

                        where i equals 11

                        Sample chapters

                        You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                        Frequently bought together

                        Corona SDK Mobile Game Development: Beginner's Guide +    WS-BPEL 2.0 for SOA Composite Applications with Oracle SOA Suite 11g =
                        50% Off
                        the second eBook
                        Price for both: $50.70

                        Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                        What you will learn from this book

                        • Optimize your game for mobile using touch and accelerometer
                        • Add sound and music to your game
                        • Master game physics such as collision detection
                        • Add achievements and leaderboards with OpenFeint and Game Center
                        • Monetize your game with in app purchase and advertising.
                        • Make your game socially aware by sharing messages and scores on Facebook and Twitter.

                        In Detail

                        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.

                        Approach

                        You will learn by doing. First a brief crash course in Lua and Corona. Once this is done you will be thrown straight into creating fully functional complete games chapter by chapter. Certain chapters are reserved for adding advanced features such as multiple device integration, social networking and monetization.

                        Who this book is for

                        This book is for anyone who wants to have a go at creating commercially successfully games for Android and iOS. You don’t need game development or programming experience.

                        Code Download and Errata
                        Packt Anytime, Anywhere
                        Register Books
                        Print Upgrades
                        eBook Downloads
                        Video Support
                        Contact Us
                        Awards Voting Nominations Previous Winners
                        Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                        Resources
                        Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software