Back to project page Coloring-book.
The source code is released under:
Apache License
If you think the Android project Coloring-book listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.plattysoft.leonids.initializers; //w w w.j a v a 2 s . c o m import java.util.Random; import com.plattysoft.leonids.Particle; public class RotationSpeedInitializer implements ParticleInitializer { private float mMinRotationSpeed; private float mMaxRotationSpeed; public RotationSpeedInitializer(float minRotationSpeed, float maxRotationSpeed) { mMinRotationSpeed = minRotationSpeed; mMaxRotationSpeed = maxRotationSpeed; } @Override public void initParticle(Particle p, Random r) { float rotationSpeed = r.nextFloat()*(mMaxRotationSpeed-mMinRotationSpeed) + mMinRotationSpeed; p.mRotationSpeed = rotationSpeed; } }