Learn how to make iOS, tvOS, macOS and watchOS games using Swift 4 and SpriteKit.
In this book, you will make 6 complete and polished mini-games, from an action game to a puzzle game to a classic platformer!
This book is for beginner to advanced iOS developers. Whether you are a complete beginner to making iOS games, or an advanced iOS developer looking to learn about SpriteKit, you will learn a lot from this book!
This book does require some basic knowledge of Swift.
This section covers the basics of making 2D games with Sprite Kit. These are the most important techniques, the ones you’ll use in almost every game you make. By the time you reach the end of this section, you’ll be ready to make your own simple game. Throughout this section you will create an action game called Zombie Conga, where you take the role of a happy-go-lucky zombie who just wants to party! You will build this game across seven chapters, in stages:
Get started by adding your first sprites to the game: the background and the zombie.
You’ll make the zombie follow your touches around the screen and get a crash-course in basic 2D vector math.
You’ll add cats and crazy cat ladies to the game, as well as basic collision detection and gameplay.
You’ll add a main menu to the game, as well as win and lose scenes.
You’ll make the game scroll from left to right, and finally, add the conga line itself.
You’ll add a label to show the zombie’s lives and the number of cats in his conga line.
You’ll begin by creating the first level of the game. By the end, you’ll have a better understanding of Xcode’s level designer, better known as the scene editor.
In this section, you will learn how to use the built-in 2D physics engine included with Sprite Kit to create movement as realistic as that in Angry Birds or Cut the Rope. You will also learn how to use special types of nodes that allow you to play videos or create shapes in your game. In the process, you will create a physics puzzle game called Cat Nap, where you take the role of a cat who has had a long day and just wants to go to bed. You will build this game across five chapters, in stages:
In this chapter, you’re going to make a little detour in order to learn the basics of creating physics simulations for your games. As a bonus, you’ll learn how to prototype games inside an Xcode playground.
You’ll learn about physics-based collision detection and create custom classes for your Sprite Kit nodes.
You’ll add two more levels to the game as you learn about interactive bodies, joints between bodies, composed bodies and more.
You’ll add special new blocks to Cat Nap while learning about additional types of nodes that allow you to do amazing things—like play videos, crop images and create dynamic shapes.
In this section, you’ll revisit the game “Pest Control”, first introduced in iOS Games by Tutorials. This new and improved version uses the new tile maps features in SpriteKit and covers saving and loading game data.
You’ll learn the basics about tile maps in SpriteKit by creating a tile set and a background tile map.
You’ll take things a step further by learning how to access tile maps in code and how to create a tile map with randomly placed tiles.
You’ll finish up by adding a winning end state and a heads-up display. You’ll also learn how to automatically save the game when you leave it and then reload it from where you left off.
In this section, you’ll also learn how to take a good game and make it great by adding a ton of special effects and excitement – a.k.a. “juice.” In the process, you will create a game called Drop Charge, where you’re a space hero with a mission to blow up an alien space ship – and escape with your life before it explodes. To do this, you must jump from platform to platform, collecting special boosts along the way. Just be careful not to fall into the red hot lava! You will build this game across four chapters, in stages:
You’ll put together the basic gameplay using the scene editor and code, flexing the Sprite Kit muscles you’ve developed working through previous chapters.
You’ll learn how to use particle systems to create amazing special effects.
You’ll trick out your game with music, sound, animation, more particles and other special effects, experiencing for yourself the benefits of mastering the details.
n this section, you’ll learn how to leverage your iOS knowledge to build games for the other Apple Platforms: macOS, tvOS and watchOS. In the process, you’ll create a game named Zombie Piranhas. In this game, your goal is to catch as many fish as possible without hooking a zombie — because we all know what happens when zombies are around.
You’ll take a complete iOS game and add a target for macOS. Along the way, you’ll learn some of the differences between the platforms, such as windows and mouse and keyboard events.
Building from Chapter 18, you’ll add another target for tvOS. You’ll learn concepts such as Focus and parallax icons, Top Shelf and working with the Apple TV Remote.
Lastly, you’ll add a target for watchOS, and you’ll learn about gestures, the Digital Crown and Haptic Feedback. You’ll also discover some of the design considerations when working with a small device.
In this section, you’ll learn how to Game Center leaderboards and achievements into your game and use the ReplayKit API to share your gaming victories with the world. In the process, you will integrate these APIs into a top-down racing game called Circuit Racer, where you take the role of an elite racecar driver out to set a world record. It would be no problem if it weren’t for the debris on the track!
Enable Game Center for your game and award the user achievements for accomplishing certain feats.
Set up various leaderboards for your game and track and report the player’s scores.
You’ll learn how to allow players to record and share videos of their games with ReplayKit.
We have also included two bonus chapters in the book:
Learn about the new ARKit framework by reworking the Pest Control game and turning it into an Augmented Reality game!
If you liked the art in these mini-games and want to learn how to either hire an artist or make some art of your own, look no further than this chapter! This chapter guides you through drawing a cute cat in the style of this book with Illustrator.
The book is well paced, giving you plenty of useful information but never overwhelming. It took me from absolute novice to releasing a game in a couple months!Eddie S.
Hands down this book is THE best investment I have ever made to teach me how to code Apple games quickly and effortlessly.Jamie S.
I was expecting a book with short tutorials. However, upon downloading and opening the book, I was blown away by the content and how detailed it was.Mahdi H.