4c881027a1
- persistent files - Hiscore
18 lines
437 B
GDScript
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)
|