aboutsummaryrefslogtreecommitdiff
path: root/lib/ticked.gd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ticked.gd')
-rw-r--r--lib/ticked.gd13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ticked.gd b/lib/ticked.gd
new file mode 100644
index 0000000..cef46ab
--- /dev/null
+++ b/lib/ticked.gd
@@ -0,0 +1,13 @@
+extends Node
+class_name Ticked
+
+export var tick_rate := 1.0
+var current_tick = 0.0
+func _tick():
+ pass
+
+func _process(delta: float) -> void:
+ current_tick += delta
+ while current_tick > tick_rate:
+ _tick()
+ current_tick -= tick_rate