We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06d017a commit 366e00cCopy full SHA for 366e00c
arc-core/src/arc/math/Mathf.java
@@ -266,6 +266,11 @@ public static boolean randomBoolean(){
266
return rand.nextBoolean();
267
}
268
269
+ /** Returns true if a random value between 0 and 1 is less than the specified value. */
270
+ public static boolean randomBoolean(float chance){
271
+ return Mathf.random() < chance;
272
+ }
273
+
274
/** Returns random number between 0.0 (inclusive) and 1.0 (exclusive). */
275
public static float random(){
276
return rand.nextFloat();
0 commit comments