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     6

Creating a Cast of Characters

Static vs. Dynamic Characters

The solution to enemy spawning thus far has been to use the update method in the SKBGameScene class to create new sprites in a repeating loop until hitting a statically defined maximum. While this works fine for viewing immediate results when adding new enemy classes, it’s not an elegant or efficient solution in the long term. You need a way of introducing characters into play in such a way that you can easily change your mind without having to change the code, thereby forcing you to rebuild the project every time you add, remove, or modify your spawning ideas. In other words, you need a dynamic “cast of characters.”

You do this by having the spawning data reside in a file ...

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