aboutsummaryrefslogtreecommitdiff
path: root/lib/ticked.gd
blob: cef46ab4c69f835d189e3848f4e9ad2d895e7eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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