diff options
author | Roman Gräf <romangraef@gmail.com> | 2020-04-18 12:18:38 +0200 |
---|---|---|
committer | Roman Gräf <romangraef@gmail.com> | 2020-04-18 12:18:38 +0200 |
commit | d3e26b3e2263770faa493e39caccab4dfe81fb17 (patch) | |
tree | 45d074bcce40b02f159276169eac4a448c789c8f /lib/ticked.gd | |
parent | f6762253e43fc8dd782b026f4014d62350845ea5 (diff) | |
download | LDJam46-d3e26b3e2263770faa493e39caccab4dfe81fb17.tar.gz LDJam46-d3e26b3e2263770faa493e39caccab4dfe81fb17.tar.bz2 LDJam46-d3e26b3e2263770faa493e39caccab4dfe81fb17.zip |
Programmierer und Riots
Diffstat (limited to 'lib/ticked.gd')
-rw-r--r-- | lib/ticked.gd | 13 |
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 |