My tilemap has a “torch” tile. I am using a CCParticleSystemQuad emitter to make the fire effect.
The emitter is children of the tilemap (directly above the torch tile).
However, the player can move and the tilemap will move as well (to center the “camera” on the player). When that happens, naturally the emitter will move as well. But here’s the problem: such movement gives an effect like…. like if the torch was moving, and not the player (which is actually the case, but this effect isn’t good).
Hard to explain. Just make a fire emitter, put as children of tilemap, and move the tilemap to the right. The effect is cool but doesn’t make sense.
Any ideas? I though of moving every single existing particle in the emitter, but that doesn’t sound good for performance (I got lots of emitters with hundreds/thousands of particles, and the map scrolls almost every single frame)
The CCParticleSystem has a positionType property with which you can change the position behavior of the emitted particles.
The enum is defined as follows:
You will want your particles to be positioned either relative or grouped. There’s a subtle difference between the two, just try one and then the other to see which fits your use case better.
Btw, this is one of the few settings that can’t be changed in the ParticleDesigner tool.