BunBunBun Posted June 6, 2017 Share Posted June 6, 2017 Hi all, I want to modify a bit the emitter, for example this: http://phaser.io/examples/v2/particles/snow but for example if we want to set positions of particles at the creating of stage, no want to wait while the snow will fill the screen: back_emitter.forEach(function(particle) { particle.x = game.rnd.integerInRange(0, game.WIDTH); particle.y = game.rnd.integerInRange(0, game.HEIGHT); particle.body.velocity.y = game.rnd.integerInRange(140, 240); }); But looks like that velocity don't work. What's wrong with code? Link to comment Share on other sites More sharing options...
BunBunBun Posted June 6, 2017 Author Share Posted June 6, 2017 what I trying to do: imagine that need to do "snow already is going on the screen" no just "snow is started". so I want to place particles first, then say "go!". Link to comment Share on other sites More sharing options...
BunBunBun Posted June 6, 2017 Author Share Posted June 6, 2017 simple solution: for(var i = 0; i < 50; i++){ back_emitter.emitParticle(randPosX,randPosX); } Link to comment Share on other sites More sharing options...
samme Posted June 6, 2017 Share Posted June 6, 2017 I think your first example would have worked with particle.exists = true; BunBunBun 1 Link to comment Share on other sites More sharing options...
BunBunBun Posted June 7, 2017 Author Share Posted June 7, 2017 @samme yep! also works. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts