aboutsummaryrefslogtreecommitdiff
path: root/lib/ticked.gd
diff options
context:
space:
mode:
authorRoman Gräf <romangraef@gmail.com>2020-04-19 16:00:58 +0200
committerRoman Gräf <romangraef@gmail.com>2020-04-19 16:00:58 +0200
commit4d59eb6a96cb2b2e2fc5d1d34a04292fd376fe0a (patch)
treeb2f4ea47107c010ad00cba0648fe26821e1a7ae3 /lib/ticked.gd
parent4ada18ddb40c5cdc4f05ad18accd4f79290543c5 (diff)
downloadLDJam46-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.gd5
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