iOS 9 Game Development Essentials
eBook - ePub

iOS 9 Game Development Essentials

Chuck Gaffney

Share book
  1. 224 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

iOS 9 Game Development Essentials

Chuck Gaffney

Book details
Book preview
Table of contents
Citations

About This Book

Design, build, and publish an iOS game from scratch using the stunning features of iOS 9

About This Book

  • Create storyboards in Xcode from concept to code and design
  • Chalk out your game's overall navigation and structure
  • Work with 2D and 3D game development tools

Who This Book Is For

This book is intended for game developers who wish to develop 2D and 3D games for iPhone and iPad. If you are a developer from another platform, or game engine such as Android or Unity, a current iOS developer wishing to learn more about Swift and the latest features of iOS 9, or even if you are new to game development, then this book is for you. Some prior programming knowledge is recommended, but not required.

What You Will Learn

  • Familiarise yourself with both basic and advanced Swift game development code
  • Understand the structure and flow of a typical iOS app
  • Work with the SpriteKit framework to make 2D games, sprites, and overlays
  • Discover 3D game development with SceneKit
  • Visually design levels and game assets with XCode 7's latest features
  • Explore the concept of component-based structuring with iOS 9's Gameplaykit
  • Beta test and publish your game with iTunes Connect

In Detail

Game development has always been a combination of programming and art, and mobile game development is no exception to this rule. The iOS platform has been both a staple in the ever-growing mobile game market, as well as a launching point for many game developers (hobby and career-wise). The features and frameworks available in iOS 9 continue to cater to the synergy of design and computer engineering, using tools that allow developers to take a game idea from concept to application in record time.

Whether you are new to iOS and game development as a whole, or are an experienced programmer wanting to learn the latest features of the platform, iOS 9 Game Development Essentials will provide you with crucial insight into this widely used platform.

Starting with the Swift programming language, this book gets the ball rolling with code concepts and game-centric code samples right from the get-go, giving you get a solid understanding of Apple's cutting-edge programming language. The book takes you through iOS game development concepts and introduces the various frameworks that allow you to develop robust, reusable, and intelligent game components in both 2D and 3D game environments.

Style and approach

This book is a step-by-step guide into the code and concepts of iOS apps. Each chapter contains diagrams that showcase the features of the platform, along with code samples from Apple and code samples exclusive to this book.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is iOS 9 Game Development Essentials an online PDF/ePUB?
Yes, you can access iOS 9 Game Development Essentials by Chuck Gaffney in PDF and/or ePUB format, as well as other popular books in Computer Science & Open Source Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784391430
Edition
1

iOS 9 Game Development Essentials


Table of Contents

iOS 9 Game Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. The Swift Programming Language
Hello World!
No more semicolons
Variables, constants, and primitive data types
Variables
Constants
More about constants

Arrays, matrices, sets, and dictionaries
Arrays
2D arrays / matrices
Sets
Dictionaries
Mutable/immutable collections
Editing/accessing collection data
Iterating through collection types
Objective-C and Swift comparison
Objective-C
Swift
Characters and strings
String Interpolation
Mutating strings
String indices
Commenting in Swift
Boolean
Ints, UInts, floats, and doubles
Integers and unsigned integers
Floats and doubles
Objects in Swift
Type safety and type inference
Optionals
Unwrapping optionals
Optional binding and chaining
Control flow in Swift
If statements
For loops
Do-while loops
Switch statements
Functions and classes
Functions
Tuples
Classes
Summary
2. Structuring and Planning a Game Using iOS 9 Storyboards and Segues
Model-View-Controller
An iOS app's lifecycle
The main() function
The UIApplication class/object
The AppDelegate class
View controllers
View controller types
Storyboards and segues
Segues
Storyboards versus coding
Summary
3. SpriteKit and 2D Game Design
A brief history of iOS game development engines
The game loop
Tile game – SwiftSweeper
What is SwiftSweeper?
Creating our SpriteKit game
An overview of the SpriteKit structure and objects
Scene transitions and the choice of code, storyboards, and/or SKS files
An SKTransition example
A SKScene/storyboard example
SKScene transitions with SKS files
Assets, sprites, and icons
Sprite atlases and animating sprites
Creating our game logic
GameBoard
Putting it all together in GameScene.swift
DemoBots
Summary
4. SceneKit and 3D Game Design
SceneKit basics and working with nodes
SpriteKit / SceneKit interactivity
The issue with inheritance-based structuring and game design
Our first SceneKit scene – the Xcode template
SceneKit project flow and structure
SceneKit Debugging Options
Handling user input in SceneKit
SceneKit features introduced in iOS 9 / Xcode 7
Audio nodes and 3D sound
Ambience and music
SpriteKit scene transitions in SceneKit
Fox demo
Particle systems
Placing particles into our pioscene
SpriteKit
SceneKit
Introducing SceneKit and SpriteKit physics
Visually composed game scenescgs
Summary
5. GameplayKit
Entities and components
Using GKEntity and GKComponent objects in our games
State machines
Agents, goals, and behaviors
Pathfinding
MinMaxAI
Random sources
Rule systems
Summary
6. Exhibit the Metal in Your Game
The Apple Metal API and the graphics pipeline
CPU/GPU framework levels
Graphics pipeline overview
What are shaders?
Types of shaders
Why is Metal faster than OpenGL ES?
The basic Metal object/code structure
Summary
7. Publishing Our iOS Game
The ever changing process of app submission
Before submitting your app
Preparing our apps for iTunes Connect
Submitting your app in the testing/beta phase
Creating an iTunes Connect app record
Updating the build string
Archive and validate your app
Upload your app to iTunes Connect
Beta test your game with the TestFlight service
External tester invites
Analyzing crash reports and feedback from testers
Submitting your game for review
Updating your game
Summary
8. The Future of iOS Game Development
A greater focus on functional programming
The Apple Watch
Component-based structuring
The rise of VR
Summary
Index

iOS 9 Game Development Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2015
Production reference: 1261015
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-143-0
www.packtpub.com
Cover image by Chuck Gaffney

Credits

Author
Chuck Gaffney
Reviewers
Mohit Athwani
Rahul Borawar
Chady Kassouf
Joni Mikkola
Commissioning Editor
Julian Ursell
Acquisition Editors
Vinay Argekar
Sonali Vernekar
Content Development Editor
Parita Khedekar
Technical Editor
Edwin Moses
Copy Editor
Dipti Mankame
Project Coordinator
Judie Jose
Proofreader
Safis Editing
Indexer
Hemangini Bari
Graphics
Abhinash Sahu
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur

About the Author

Chuck Gaffney is a programmer, voice actor, and game developer. He owns a company, Chuck's Anime Shrine, and has worked for some studios in New York. Some of Chuck's recent projects include VR and Unity projects for major studios and business firms, in addition to iOS and Swift programming.

About the Reviewers

Mohit Athwani is a self-taught iOS developer and has been developing apps since the early days of iOS 3. He has worked with several clients all around the world, and has carried out intense research in the field of facial detection and recognition on iOS. His app, iRajanee, became the number one app on the Indian app store, and has fetched him tremendous success.
Mohit started his company Geeks (http://www.geeksincorporated.net) with a friend in 2010, and has since also involved himself in conducting training sessions on iOS for students and corporates. His website, http://indianios.guru/, hosts a lot of introductory videos and tutorials on developing for iOS with Swift.

Table of contents