Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maxParticles seems to have no effect above 40 #330

Closed
fyyyyy opened this issue Aug 24, 2017 · 5 comments
Closed

maxParticles seems to have no effect above 40 #330

fyyyyy opened this issue Aug 24, 2017 · 5 comments

Comments

@fyyyyy
Copy link

fyyyyy commented Aug 24, 2017

  • A bug in the API:
    • Phaser version(s): 2.6.1. to 2.8.4

    • Live example: https://codepen.io/anon/pen/jLpWeY?editors=0010

    • What should happen:
      maxParticles should have an effect on how many particles are shown on screen.
      Any value above 40 seems to have no effect. I would expect thousands of particles to show up.
      Values below 40 will gradually decrease particles on screen as it should.

    • What happens instead:
      Only about 30 particles are rendered on screen
      No matter which settings i try for maxParticles or emitter.start, i never get to render more than 30 particles on screen

@fyyyyy fyyyyy changed the title maxParticles seems to have no effect maxParticles seems to have no effect above 40 Aug 24, 2017
@samme
Copy link
Collaborator

samme commented Aug 24, 2017

See https://codepen.io/samme/pen/MvBOzb?editors=0010.

start(explode=false) always releases 1 particle per emit, so its maximum flow rate is ~60 particles per second.

Use Emitter#flow instead, which is simpler and also allows quantity > 1.

@fyyyyy
Copy link
Author

fyyyyy commented Aug 25, 2017

Thanks, thats good news. I guess this is a documentation request then :D
https://phaser.io/docs/2.6.2/Phaser.Particles.Arcade.Emitter.html#start

@samme
Copy link
Collaborator

samme commented Aug 26, 2017

phaser-ce/Phaser.Particles.Arcade.Emitter.html#start is a little better.

@samme samme closed this as completed in 8ee201d Aug 26, 2017
@fyyyyy
Copy link
Author

fyyyyy commented Aug 26, 2017

Hmm i see. However, frequency cannot be a float value. As in my example rain.start(false, 200, 0.01, 0); i try to lower the frequency to 10 us. However 1 seems to be the lowest value accepted (other than 0) ?

@samme
Copy link
Collaborator

samme commented Aug 26, 2017

You can even use frequency=0, but the release rate is never greater than the game update rate (60 updates per second, 16.66ms).

You need to use flow, e.g.,

rain.flow(500, (1000/60), 33);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants