Skip to Main Content
Learn Sprite Kit for iOS Game Development
book

Learn Sprite Kit for iOS Game Development

by Leland Long
June 2014
Beginner content levelBeginner
256 pages
5h 38m
English
Apress
Content preview from Learn Sprite Kit for iOS Game Development

Chapter     9

Add More Scenes and Levels

Multiple Player Lives

Before you begin adding more levels to the game, you have some additional details to implement. For instance, you’ll want the player to be able to “die” more than once in the game without the game ending. You will have the game start with several player lives, so that when a nasty vermin bites the player, it can reappear a few seconds later, ready to tackle them again. After all, accidents happen and vermin are vicious and sewers are stinky, but your hero is resilient and will survive! Hopefully.

First you need to add a constant that will determine the number of lives with which the player starts each game. Add this line at the top of the SKBGameScene.h file:

#import "SKBRatz.h"
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Build iOS Games with Sprite Kit

Build iOS Games with Sprite Kit

Jonathan Penn, Josh Smith
Beginning Swift Games Development for iOS

Beginning Swift Games Development for iOS

James Goodwill, Wesley Matlock
Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Stefan Kaczmarek, Brad Lees, Gary Bennett, Mitch Fisher

Publisher Resources

ISBN: 9781430264408Purchase book