Your games will often require the ability to run code when the player taps a specific sprite. I like to implement a system that includes all the sprites in your game so you can add tap events to each sprite without building an additional structure. We have already implemented onTap
methods in all of our classes that adopt the GameSprite
protocol; we still need to wire up the scene to call these methods when the player taps the sprites.
Game Development with Swift
By :
Game Development with Swift
By:
Overview of this book
Table of Contents (18 chapters)
Game Development with Swift
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Designing Games with Swift
Sprites, Camera, Actions!
Mix in the Physics
Adding Controls
Spawning Enemies, Coins, and Power-ups
Generating a Never-Ending World
Implementing Collision Events
Polishing to a Shine – HUD, Parallax Backgrounds, Particles, and More
Adding Menus and Sounds
Integrating with Game Center
Ship It! Preparing for the App Store and Publication
Index
Customer Reviews