Skip to main content

Creating a Cast of Characters

  • Chapter
  • First Online:
Learn Sprite Kit for iOS Game Development
  • 593 Accesses

Abstract

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.”

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Leland Long

About this chapter

Cite this chapter

Long, L. (2014). Creating a Cast of Characters. In: Learn Sprite Kit for iOS Game Development. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-6440-8_6

Download citation

Publish with us

Policies and ethics