You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting the burst count using the rand() function, the burst behaves wierdly, or random, too random. Sometimes the children are not spread out evenly, sometimes it's like the last childs is still playing. Compare this to when you set either count to, 2, 3, 4, 5 or 6 directly compared to 'rand(2, 6)'.
This isn't a bug. There are two problems here @Sandstedt.
When you use the rand function without truncating the result the rand function generates decimal values that causes the library to generate the particles in a wrong way.
In the code you wrote the library will always generate the same number of particles when you click because the example constant is stored in memory and is not regenerated when you click the button.
The solution to your code and to get what you expected from the library is the following:
I haven't found the time to dive more into this issue, but from what I remember, it looks related to float stuff regarding the count property when using rand MoJS internal method.
I am keeping this open in order to investigate later.
When setting the burst count using the
rand()
function, the burst behaves wierdly, or random, too random. Sometimes the children are not spread out evenly, sometimes it's like the last childs is still playing. Compare this to when you set either count to, 2, 3, 4, 5 or 6 directly compared to'rand(2, 6)'
.Example:
Bug reproduction pen:
https://codepen.io/sandstedt/pen/Vwjdroy
The text was updated successfully, but these errors were encountered: