Jump to content

[SOLVED] Need help with emitter class, how to emit particles at the start?


BunBunBun
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

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