Book Image

Mastering iOS Game Development

By : Peter Ahlgren, Miguel DeQuadros
Book Image

Mastering iOS Game Development

By: Peter Ahlgren, Miguel DeQuadros

Overview of this book

iOS is an operating system for Apple manufactured phones and tablets. Mobile gaming is one of the fastest-growing industries, and compatibility with iOS is now becoming the norm for game developers. SpriteKit is part of the native SDK from Apple, and enables developers to make simple entry into game development without unnecessary overhead and a long learning process. SpriteKit also provides other functionality that is useful for games, including basic sound playback support and physics simulation. In addition, Xcode provides built-in support for SpriteKit so that you can create complex special effects and texture atlases directly in Xcode. This combination of framework and tools makes SpriteKit a good choice for games and other apps that require similar kinds of animation. Become a master in iOS game development through this fast and fun guide! In the beginning, we’ll tell you everything you need to plan and design your game. You’ll then start developing your game through step-by-step instructions using the various built-in technologies of Xcode. From there on, we discuss how to deploy your game to the iOS App Store, as well as monetizing it to make more revenue. You will also learn advanced techniques to improve your game playing experience, including better multi-tasking, improved performance optimization, battery management, and more. To end the book off, we’ll show you how to update your game with different features, then port the update to the App Store.
Table of Contents (15 chapters)

Preface

Welcome! We all love game development and many of us dream of games we want to play, but alas, we never see them released. You are here to make that game, the one you've been planning, drawing, and dying to create for a long time. With the help of this book and with your awesome ideas, you will succeed in creating your dream game. In this book, you will learn how to use the free software available to you to create, develop, and release your awesome creations.

Welcome and enjoy the ride!

What this book covers

Chapter 1, What to Expect in Xcode and Game Development, covers how to become an Apple developer, how to download Xcode and the iOS development kit, and what to expect of the game development industry.

Chapter 2, Creating the Stuff, demonstrates how to use the various tools available to you to create sprites and various other images, sound effects, and even videos for your game.

Chapter 3, Blast Off! Starting with Development, talks about beginning our project. You will learn how to import various frameworks for our project and create our character and get him moving.

Chapter 4, Let's Keep Going! Adding More Functionality, discusses how to add some cool effects, such as particles for flames and rain, to our game now that our project is coming together.

Chapter 5, Bug Squashing – Testing and Debugging, covers testing our game and debugging it to ensure that there are no issues in it once we port our game.

Chapter 6, Making Our Game More Efficient, shows how we can make our game run better on all devices now that it is running flawlessly. By doing this, we will increase battery life, performance, and the overall user experience.

Chapter 7, Deploying and Monetizing, discusses how to show our game to the world and increase our revenue outlets by adding monetizing options.

Chapter 8, It's Too Dangerous to Go Alone, Take a Friend!, talks about making our game multiplayer after much planning, as we are now ready to update our game. We will incorporate multiplayer connectivity to find friends to play with!

What you need for this book

For this book, all that you need is Xcode, which is Apple's software development kit for iOS, and any image creation software, such as Gimp or Photoshop.

Who this book is for

This book is for all those who have a little experience of iOS development but really want to hone their skills.

Conventions

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, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We will add another NSString class at the top of our MultiplayerHelper.m file."

A block of code is set as follows:

- (void)match:(GKMatch *)match didFailWithError:(NSError *)error {
    
    if (_match != match) return;
    
    NSLog(@"Match failed with error: %@", error.localizedDescription);
    _matchStarted = NO;
    [_delegate matchEnded];
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

- (void)update:(NSTimeInterval)delta {
    
    CGPoint gravity = CGPointMake(0.0, -450.0);
    
    CGPoint gravityStep = CGPointMultiplyScalar(gravity, delta);
    
   CGPoint movingForward = CGPointMake(750.0, 0.0);
   CGPoint movingForwardStep = CGPointMultiplyScalar(walking, delta);

    self.velocity = CGPointAdd(self.velocity, gravityStep);

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "For this project, we are—obviously—going to select iOS | Application | Single View Application and then click on Next.".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

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 , and mention the book title via 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.

Customer support

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.

Downloading the example code

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.

Errata

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/submit-errata, 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 on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.