aboutsummaryrefslogtreecommitdiff
path: root/src/math.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/math.odin')
-rw-r--r--src/math.odin5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/math.odin b/src/math.odin
index bfc0013..fd81ac8 100644
--- a/src/math.odin
+++ b/src/math.odin
@@ -2,6 +2,7 @@ package demonchime
import "core:math"
import "core:math/linalg"
+import "core:math/rand"
import "fw"
@@ -19,3 +20,7 @@ dt_lerp_arr :: proc(a: [$N]$T, b: [N]T, t: T) -> [N]T {
dt := T(fw.get_delta_time())
return linalg.lerp(b, a, math.pow(0.5, dt * t))
}
+
+coin_flip :: proc(rng := context.random_generator) -> bool {
+ return rand.int32_range(1, 3) == 1
+}