Book Image

iOS Game Programming Cookbook

Book Image

iOS Game Programming Cookbook

Overview of this book

Table of Contents (19 chapters)
iOS Game Programming Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Particle emitter integration


Now we are ready and equipped for the particle system to be added to our game FlyingSpaceship. In this section, we will take the FireParticle and SmokeParticle files, create a SKEmitterNode object for the respective file and add it to the respective entity on some event.

After all this, a thrust for the spaceship will be visible in the game making our character more empowered. Also, a collision smoke effect will be seen when a coin is picked by the spaceship.

Getting ready

We will start by adding emitters in the games. We should also go through the documentation of the SKEmitterNode class provided in the preceding sections. And then we can continue adding the code for the addition of the spaceship's thrust in the starter kit of this chapter.

How to do it

Continuing with the same Xcode project, now we will create our solution kit for this chapter that is, Chapter 4.

The following are the steps to add the spaceship's thrust in our game:

  1. Open the FSMyScene class and add...