drawcall / Proton

Javascript particle animation library
https://drawcall.github.io/Proton/
MIT License
2.41k stars 275 forks source link

change speed #22

Closed jasperblues closed 8 years ago

jasperblues commented 8 years ago

Hello. Incredible work!

Using the 'drugs' sample, how to we slow the speed down to about 25%?

proton = new Proton;
  emitter = new Proton.Emitter();
  emitter.rate = new Proton.Rate(new Proton.Span(5, 10), new Proton.Span(.05, .2));
  emitter.addInitialize(new Proton.ImageTarget(image));
  emitter.addInitialize(new Proton.Mass(1));
  emitter.addInitialize(new Proton.Life(2, 4));
  emitter.addInitialize(new Proton.V(new Proton.Span(0.5, 1.5), new Proton.Span(0, 360), 'polar'));
  emitter.addBehaviour(new Proton.Alpha(1, [.7, 1]));
  emitter.addBehaviour(new Proton.Scale(1, 0));
  emitter.addBehaviour(new Proton.Color('random', '#9e24e7', Infinity, Proton.easeInSine));
  emitter.p.x = canvas.width / 2;
  emitter.p.y = canvas.height / 2;
  emitter.emit();
  proton.addEmitter(emitter);
  renderer = new Proton.Renderer('canvas', proton, canvas);
  renderer.start();

^---- Which parameter to modify above?

jasperblues commented 8 years ago

Found it, thanks. Closing issue.

mspanish commented 7 years ago

could you help out others by posting the solution?

mspanish commented 7 years ago

For me with easeljs the only way to slow down a particle animation is to adjust the FPS, which I can't do as I have other elements that need it to be 60.

I tried using Proton.Velocity and that didn't help either. I hope I'm overlooking something simple here!