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

Chapter 4. Game Controls

So far, we have completed the first half of our game in the previous chapter. We started by developing the initial structure for the project by introducing the game objects to the screen. Currently, the paddle and ball movement is inactive, but everything displayed in the simulator is scaled according to the original game design. The last phase of completing this tutorial is to add in all the actions that will occur in the game, including object movement and updating the score.

In this chapter, we will cover the following topics:

  • Moving the paddle using touch events and accelerometer

  • Collision detection between all game objects in the scene

  • Removing objects upon collision detection

  • Ball movement within the screen boundaries

  • Calculating the score

  • Win and lose conditions

Home stretch! We can do it!