Sprite Kit is a set of tools to develop 2D games for the Apple iOS platform. Sprite Kit provides powerful features for graphics and the animation of images having texture, and so on. It is one of the best available game engines for iOS devices. It is very simple and powerful, with full support provided by Apple, hence it is more reliable and convenient than any third-party game engine available today.
The Integrated Development Environment (IDE), Xcode, provided by Apple for app development can also be used for Sprite Kit game development. Objective-C or Swift, either of the two programming languages can be used for Sprite Kit game development. Sprite Kit is already being used by many developers for iOS game development. There is a good amount of information available that focuses on Sprite Kit set up and development. However, a structured and concise resource discussing about the complete development process and feature set is not currently available. This book explains the basics of Sprite Kit development and allows a beginner to become skilled in Sprite Kit game development using the Swift programming language with its complete set of development features. This book is a complete guide for Sprite Kit and a perfect starting point for those wanting to set sail on the iOS game industry.
Chapter 1, An Introduction to Sprite Kit, introduces you to the Sprite Kit game engine, along with its various elements and features. It also helps in setting up a new Xcode project for developing a Sprite Kit game.
Chapter 2, Scenes in Sprite Kit, explains an important topic in Sprite Kit, that is, scenes. Along with this, there is a brief about the node tree drawing order.
Chapter 3, Sprites, explains sprites and their properties. It also applies some of the properties in the example game.
Chapter 4, Nodes in Sprite Kit, discusses about nodes and its subclasses in detail. It also explains the implementation of various node subclasses in the example game.
Chapter 5, Physics in Sprite Kit, talks about physics simulation in a Sprite Kit game. It explains the types of physics bodies. Physics capabilities are applied to the example game in this chapter.
Chapter 6, Animating Sprites, Controls, and SceneKit, covers animating nodes and adding controls to a Sprite Kit game. These features are added in the example game. It also talks about SceneKit.
Chapter 7, Particle Effects and Shaders, discusses about particle effects and shaders, along with their implementation in the example game.
Chapter 8, Handling Multiple Scenes and Levels, helps us understand the need for different levels in a game. This chapter also explains how to create multiple scenes.
Chapter 9, Performance Enhancement and Extras, discusses in detail how to improve the performance of a Sprite Kit game, along with performance measuring using instruments. It also explains the scoring system, sound, and player running animation in the example game.
Chapter 10, Revisiting Our Game and More on iOS 9, discusses the various steps involved in the development of a game, and introduces readers to the Game Center and discusses new features that will be introduced in iOS 9.
Readers will require Xcode, which is the IDE provided by Apple for developing software, and also the sample game for Mac OS X and iOS devices. An iOS-running device will be helpful to the readers for running the example game that is being developed in the book.
This book is for beginners who want to start their game development odyssey on the iOS platform. If you are an intermediate or proficient game developer hailing from a different development platform, this book will be the perfect gateway into the Sprite Kit engine. The reader does not need to have any prior knowledge of Sprite Kit, and building games on the iOS platform.
In this book, you will find a number of text styles 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: "To make a sprite in a game, we have to make an instance of the SKSpriteNode
class."
A block of code is set as follows:
init(name: String){ //it is designated initializer . initialization part } convenience init(){ //Calling the Designated Initializer in same class self.init(name: "Hello") }
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Untick the Portrait checkbox and tick Landscape Left under the Device Orientation section."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>
, and mention the book's title in 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 at 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.
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from: https://www.packtpub.com/sites/default/files/downloads/B04201_4694OS_Graphics.pdf.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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 could 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 to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted 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.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>
, and we will do our best to address the problem.