E-Book Overview
Game apps are one of the most popular categories in the Apple iTunes App Store. Well, the introduction of the new Swift programming language will make game development even more appealing and easier to existing and future iOS app developers. In response, James Goodwill, Wesley Matlock and Apress introduce you to this book, Beginning Swift Games Development for iOS. In this book, you'll learn the fundamental elements of the new Swift language as applied to game development for iOS. In part 1, you'll start with a basic 2D game idea and build the game throughout the book introducing each SpriteKit topic as we add new functionality to the game. By the end of the book, you'll have experience with all the important SpriteKit topics and have a fully functional game as a result. In part 2 of this book, you'll learn 3D game development using Apple's SceneKit framework and the Swift programming language. And, you'll follow the same pattern we used for part 1. After reading and using this book, you'll have the skills and the code to build your first 2D and then 3D game app that you can run on any iOS enabled device and perhaps sell in the Apple iTunes App Store.
E-Book Content
s de K D clu In 8 S
S iO
Beginning
Swift Games
Development for iOS James Goodwill | Wesley Matlock
www.it-ebooks.info
For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them.
www.it-ebooks.info
Contents at a Glance About the Authors�������������������������������������������������������������������������������������������������� xiii About the Technical Reviewer���������������������������������������������������������������������������������xv Acknowledgments�������������������������������������������������������������������������������������������������xvii Introduction������������������������������������������������������������������������������������������������������������xix
■■Part I: Swift and Sprite Kit����������������������������������������������������������������� 1 ■■Chapter 1: Setting Up Your Game Scene and Adding Your First Sprites���������������� 3 ■■Chapter 2: Sprite Kit Scenes and SKNode Positioning����������������������������������������� 19 ■■Chapter 3: Adding Physics and Collision Detection to Your Game���������������������� 33 ■■Chapter 4: Adding Scene Scrolling and Game Control����������������������������������������� 47 ■■Chapter 5: Adding Actions and Animations��������������������������������������������������������� 59 ■■Chapter 6: Adding Particle Effects to Your Game with Emitter Nodes����������������� 79 ■■Chapter 7: Adding Points and Sound������������������������������������������������������������������� 97 ■■Chapter 8: Transitioning Between Scenes��������������������������������������������������������� 113 ■■Chapter 9: Sprite Kit Best Practices������������������������������������������������������������������ 127
v
www.it-ebooks.info
vi
Contents at a Glance
■■Part II: Swift and Scene Kit������������������������������������������������������������ 141 ■■Chapter 10: Creating Your First Scene Kit Project��������������������������������������������� 143 ■■Chapter 11: Building the Scene������������������������������������������������������������������������� 155 ■■Chapter 12: Lighting, Camera, and Material Effects in Scene Kit���������������������� 169 ■■Chapter 13: Animating Your Models������������������������������������������������������������������ 181 ■■Chapter 14: Hit Testing and Collision Detection������������������������������������������������ 189 ■■Chapter 15: Using Sprite Kit with a Scene Kit Scene���������������������������������������� 201 ■■Chapter 16: Advanced Topics and Tips������