diff options
author | Roman Gräf <romangraef@gmail.com> | 2020-04-19 16:00:58 +0200 |
---|---|---|
committer | Roman Gräf <romangraef@gmail.com> | 2020-04-19 16:00:58 +0200 |
commit | 4d59eb6a96cb2b2e2fc5d1d34a04292fd376fe0a (patch) | |
tree | b2f4ea47107c010ad00cba0648fe26821e1a7ae3 /lib/ticked.gd | |
parent | 4ada18ddb40c5cdc4f05ad18accd4f79290543c5 (diff) | |
download | LDJam46-4d59eb6a96cb2b2e2fc5d1d34a04292fd376fe0a.tar.gz LDJam46-4d59eb6a96cb2b2e2fc5d1d34a04292fd376fe0a.tar.bz2 LDJam46-4d59eb6a96cb2b2e2fc5d1d34a04292fd376fe0a.zip |
Mehr riot kram, i guess
Diffstat (limited to 'lib/ticked.gd')
-rw-r--r-- | lib/ticked.gd | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ticked.gd b/lib/ticked.gd index cef46ab..cacfaef 100644 --- a/lib/ticked.gd +++ b/lib/ticked.gd @@ -1,4 +1,4 @@ -extends Node +extends Node2D class_name Ticked export var tick_rate := 1.0 @@ -8,6 +8,9 @@ func _tick(): func _process(delta: float) -> void: current_tick += delta + if tick_rate < 0: + current_tick = 0 + return while current_tick > tick_rate: _tick() current_tick -= tick_rate |