init
This commit is contained in:
commit
b99855351d
434 changed files with 50357 additions and 0 deletions
20
scripts/counter.gd
Normal file
20
scripts/counter.gd
Normal 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))
|
Loading…
Add table
Add a link
Reference in a new issue