jjwallace Posted May 3, 2017 Share Posted May 3, 2017 I have a particle generator of lighting bolts and i want them to generate at random angles around an object. The particles do not move but just play an animation. Everything is working i just need random angles to work, how does one reference this with emitter. emitter = this.add.emitter(0, 0, 100); emitter.makeParticles('bolt'); emitter.gravity = 0; emitter.x = this.world.centerX; emitter.y = this.world.centerY; // emitter.maxParticleScale = 1; // emitter.minParticleScale = 0.5; // emitter.angle = (Math.random()*360); emitter.setYSpeed(0, 0); emitter.setXSpeed(0, 0); emitter.minRotation = -180; emitter.maxRotation = 1800; Link to comment Share on other sites More sharing options...
samid737 Posted May 4, 2017 Share Posted May 4, 2017 Not an immediate answer to your question, but an alternative you can consider if you cannot proceed is to render your lightning bolts using rendertextures. I'm not sure if this will work with animated sprites, but you can create some nice effects by tweaking your settings inside the drawing function: Link to comment Share on other sites More sharing options...
Recommended Posts