From 6f268859da30cbfb4458fb2b75a40f87967cb01c Mon Sep 17 00:00:00 2001 From: morrigan Date: Sat, 28 Jun 2025 15:47:51 +0200 Subject: [PATCH] add timer struct --- util/cooldown.odin | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 util/cooldown.odin diff --git a/util/cooldown.odin b/util/cooldown.odin new file mode 100644 index 0000000..520b0f4 --- /dev/null +++ b/util/cooldown.odin @@ -0,0 +1,10 @@ +package util + +Timer :: struct { + time: f32, +} + +tick_timer :: proc(timer: ^Timer, by: f32) -> bool { + timer.time -= by + return timer.time < 0 +}