This commit is contained in:
Gerard Gascón 2025-04-24 17:23:34 +02:00
commit b99855351d
434 changed files with 50357 additions and 0 deletions

20
scripts/counter.gd Normal file
View file

@ -0,0 +1,20 @@
extends Control
const MAX_TIME = 99
@export var start_time = 50
@export var decrease_speed = 0.5
# Called when the node enters the scene tree for the first time.
func _ready():
current_time = start_time;
$Label.text = str(int(current_time))
var current_time: float
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
current_time -= decrease_speed * delta
$Label.text = str(int(current_time))
func get_percentage() -> float:
return inverse_lerp(MAX_TIME, 0, int(current_time))