Sprite Kit is a new framework from Apple for developing 2D games for iOS devices. It is new, fresh, and exciting.
Developers have been waiting long for a native library for games, but Apple did not deliver it until Version 7.0 of their operating system. Developers had to use unreliable third-party libraries, work on fixing bugs in these libraries, and experiencing headaches when suddenly your project just stops compiling under new versions of the operating system.
All these problems can be forgotten with the new Sprite Kit framework. It allows for easy and fast game development. It mimics many methods and the API of the Cocos2d library, which is a wildly popular library for game development. If you have ever checked out Cocos2d, you will feel right at home with Sprite Kit.
iOS 7 Game Development will take you on a journey to build a game from scratch using a hands-on approach. We will start with the basics and continue with advanced topics. We will explain every bit of code for maximum understanding.
We will build an endless runner game, an amazingly popular genre on the App Store, and will explain all the systems that have to be built in order to provide the best user experience.
Chapter 1, Updates on iOS 7, provides you with a short coverage of what features iOS 7 brings to the table—operating system redesign, new frameworks, and game controller support.
Chapter 2, Our First Sprite Kit Project, explains you Sprite Kit basics, how to show a sprite on the screen, how to move it, and what properties and methods are available on sprite nodes. We will also discuss game loops and actions.
Chapter 3, Interacting with Our Game, shows you the way to control our character sprite, either by using gesture recognizers or with raw touch processing.
Chapter 4, Animating Sprites, walks you through the process of creating a texture atlas, animating our character, and creating actions to handle starting and finishing animations. We will also add nice parallax scrolling to our game.
Chapter 5, Particle Effects, explains how to create cool-looking particle effects, how to store and edit them and their properties, and ways to improve your game performance when using particle effects.
Chapter 6, Adding Game Controllers, walks you through the process of adding native game controller support to your game. We will check different controllers, their layouts, and ways to handle thumbstick, direction pad, and button inputs.
Chapter 7, Publishing to the iTunes App Store, explains how to post your application to the iTunes App Store. We will learn about different application icons, categories, certificates, provisioning profiles, new Xcode publishing features, and the review process.
You will need a Mac running OS X 10.9 and Xcode Version 5.0 or higher. You are expected to have familiarity with Objective-C.
This book is intended for those who have great ideas for games and who want to learn about iOS game development. You should know and understand Objective-C. Being familiar with iOS development is helpful, but is not required. This book will make you familiar with the new Sprite Kit framework in no time.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: “The thing that might have caught your attention is the format specifier @”run%.3d”.
”
A block of code is set as follows:
- (void) stopRunningAnimation { [self removeActionForKey:@”running”]; }
New terms and important words are shown in bold.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title through the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.