DuckRun/code/hiscore.gd
megamichi 4c881027a1 - New selfmade Font
- persistent files
- Hiscore
2024-10-09 21:02:14 +02:00

18 lines
437 B
GDScript

extends Label
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
text = str($"/root/Global".hiscore)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func set_new_hiscore():
if int(text) < int(%ScoreContainer/text.text):
text = %ScoreContainer/text.text
$"/root/Global".write_save()
func get_score():
return int(text)