I am new to Spritekit. Just starting to make my 3rd-4th game. So I'd like to know what is the correct way to use SKEmitterNode programmatically.
In particular what is the correct practice if I want to have multiple particles in my game - jet engine fire, and also multiple explosions when bullet hits enemy ship.
Do I keep on creating new SKEmitterNode and adding it to the scene or do I add a single global EmitterNode and change its properties in the update function?
// FIRE ENGINE
SKEmitterNode *_myEmitter = [[SKEmitterNode alloc] init];
// codes..
[self addChild:_myEmitter]; // add to scene
// EXPLOSION
SKEmitterNode *_myEmitter = [[SKEmitterNode alloc] init];
// codes..
[self addChild:_myEmitter]; // add to scene
OR
// IN INIT METHOD
_myEmitter = [[SKEmitterNode alloc] init]; // global variable
// codes..
[self addChild:_myEmitter]; // add once
// IN UPDATE
//when explode
_myEmitter.particleTexture = [SKTexture textureWithImageNamed:@"explode.png"];
... modify code
//when engine fire
_myEmitter.particleTexture = [SKTexture textureWithImageNamed:@"fire.png"];
... modify code
?