Gibson001 Posted February 23, 2015 Share Posted February 23, 2015 Hi guys. I want to flow (not explode at once) specified quantity of particles. The point is that I tried couple of functions and none of the worked: 1) When I'm using Emitter.start(false, 5000, 100, 10, false) then it seems to work fine but when I try to start the emitter again then the quantity provided in second invocation is addind to the first one so i.e. if for the first time I emitted 10 particles and for the second time I want to emit 20 then I got 10+20=30 particles emitted. 2) So I tried to change the last parameter (forceQuantity) to true and it helped, at least when it comes to the amount of particles, because they've got emitted all at once although the first parameter (explode) was set to false. 3) Fortunately I found in documentation function flow (hurray!). But... it failed. I found in the source code that it does nothing more than calling start function with explode=false and forceQuantity=true (so all particles are emitted all at once as I mentioned in point 2). So... do you guys have any suggestion? I'm seriously considering creating an issue because that looks like a bug for me. My suspect is line 446 in Emitter.js:this._quantity += quantity;which is causing amount of particles to sum up (as I mentioned in first point). Or maybe I just don't know what I'm doing and I'm using emitter in wrong way? I'll be very grateful for any clues. P.S. I'm using Phaser 2.2.2 Link to comment Share on other sites More sharing options...
rich Posted February 23, 2015 Share Posted February 23, 2015 https://github.com/photonstorm/phaser/issues/1598 Link to comment Share on other sites More sharing options...
Gibson001 Posted February 23, 2015 Author Share Posted February 23, 2015 https://github.com/photonstorm/phaser/issues/1598 So if I understand right, this fix will be released with next version? Link to comment Share on other sites More sharing options...
rich Posted February 23, 2015 Share Posted February 23, 2015 Yes. Although if you want it now you could take just the Emitter class from the dev branch and merge into your local build. Gibson001 1 Link to comment Share on other sites More sharing options...
Gibson001 Posted February 23, 2015 Author Share Posted February 23, 2015 Sure, great. Thanks for response, Link to comment Share on other sites More sharing options...
stupot Posted February 24, 2015 Share Posted February 24, 2015 I've been treating this as a design limitation rather than a bug, but glad to see there's been a change. I've been been handling this issue by calling kill() and setting the _quantity = 0 before calling start(). Link to comment Share on other sites More sharing options...
Recommended Posts