Jump to content

a single emitter in multiple locations


Binary Moon
 Share

Recommended Posts

Still making my little colour matcher and I want to add some particle effects.

 

What I want to do is have the particles emit from the balls as they pop. Currently I have a tween on each ball so that it shrinks down when removed and I thought that I could just set the emitter position and emit some particles.

 

My setup code (in create function) is below

        this.emitter = game.add.emitter(0, 0, 100);        this.emitter.makeParticles('dot-particles', [0,1,2,3,4,5,6]);        this.emitter.gravity = 0;        this.dots.add(this.emitter);

Then each time a bubble is popped I do:

                    this.emitter.x = dot.x;                    this.emitter.y = dot.y;                    this.emitter.start(true, 2000, null, 10);

However this only works for a single ball each time. It doesn't do anything for the others. My guess is that I can only start an emitter once per 'loop' but I don't see why. I can see that the emitter.start is being called on each loop because the associated tween for each ball is happening.

 

Any help would be most appreciated!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...