totallybueno Posted May 14, 2015 Share Posted May 14, 2015 Hi there,so I have my game and everything is working but I have this weird behavior, probably is something obvious and I´m missing something, sorry if that´s the point... Well, basically, the idea is that I have a emitter shooting missiles (3) and I set the .maxParticles to 3. The first time it shoots, it shoots 3 missiles, good for me!emitter.maxParticles=3;and I start that emitter withemitter.start(false, 2000, 100, 3);I check in the update() if one of the missiles hits the target and call this callback and I destroy that missile (I also tried kill() at first)ihityou:function(yourtarget, missile){ //DO SOME STUFF missile.destroy();},The problem is that the next time that I´m launching 3 missiles, the emitter is launching 6, and then 9, and then 12... to launch again, I´m using the same code that the first time...emitter.start(false, 2000, 100, 3);I tried the forceQuantity parameter in the start() (the fifth one) and yes, the emitter is launching just 3 missiles, but it seems that sets the first parameter to true and it launches all the missiles at the same time instead of with the frequency that I set before (100 ms.) Can anyone tell me what is happening here? I don´t know how to fix this and I guess it´s basic stuff... Thanks in advance. Link to comment Share on other sites More sharing options...
totallybueno Posted May 21, 2015 Author Share Posted May 21, 2015 Nobody has a clue about this? Is driving me crazy... Link to comment Share on other sites More sharing options...
drhayes Posted May 21, 2015 Share Posted May 21, 2015 I know this doesn't quite answer your question... but if you're firing three missiles you could create the sprites yourself? Since that would get you unblocked and let you get on with your game? And, just guessing, but reading the code for the Arcade Emitter (that's the one you're using?) start method, if you're passing a truthy value to forceQuantity then yes, it's like an explode. Try setting the fourth parameter to 0. That should emit maxParticles and then stop. Link to comment Share on other sites More sharing options...
totallybueno Posted May 25, 2015 Author Share Posted May 25, 2015 Hi there drhayes, if I set the fouth parameter to 0, the emitter is "shooting" continously... and well, I don´t wanna use three sprites because I want to fix this and learn what the hell is wrong now Link to comment Share on other sites More sharing options...
stupot Posted May 26, 2015 Share Posted May 26, 2015 The arcade particles do behave a bit odd and are hard to control. Try this before your emitter.start() call: emitter.kill(); emitter._quantity = 0; totallybueno 1 Link to comment Share on other sites More sharing options...
totallybueno Posted May 26, 2015 Author Share Posted May 26, 2015 It worked, like a charm. Leave the computer and get a beer, I pay this one. THANKS! Link to comment Share on other sites More sharing options...
Recommended Posts