Book Image

Learning Objective-C by Developing iPhone Games

By : Joseph D. Walters, Amy M. Booker
Book Image

Learning Objective-C by Developing iPhone Games

By: Joseph D. Walters, Amy M. Booker

Overview of this book

<p>The introduction of the Apple Store has empowered thousands, even millions of people to embrace software development. Using Objective-C and the Xcode IDE, you can produce awesome games and launch them on the Apple Store allowing you to make and sell games quickly and easily.</p> <p>From learning the basics of Objective-C to deploying to the App Store, you'll use this book to learn about game development in a matter-of-fact, helpful manner. Whether you're new to game development, or just want to learn how to leverage Apple's own tools to expand your skill set, you'll quickly move from a beginner to an expert.</p> <p>The book kicks off with the basics of game development, and you will take your first steps with using Xcode, the official Apple programming IDE, before moving on to the most important concepts involved in programming games using Objective-C. This book is a hands-on guide to developing the game of your dreams in no time for the Apple Store.</p>
Table of Contents (17 chapters)
Learning Objective-C by Developing iPhone Games
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
3
iPhone Game Development Basics – The Matching Game
Index

Timers and frame rates


By this point, you have seen us use a lot of timers in the game. You may have even picked up on the fact that our collision timer was set a little lower than most of our other timers. We have set it to 0.1 seconds rather than 0.03 (30 frames per second) because we were checking the collision on a couple of pretty big rectangles. The bullet couldn't get through the entire player's rectangle in a tenth of a second; so, in order to keep the number of times I check the collision down, I just reduced the number of times I called the method. This may seem a little extreme at first, but the reality is that the more you add to your screen, the more it is going to slow down. Similarly, the number of times you are checking your methods in a timer, the more you are going to slow your game down.

The motion picture industry standard for film is 24 frames per second. In the games industry, we usually lock our frame rates to 30 or 60 fps. There are some 3D games that don't lock their...