fuzzyworld

godot-shooter / meteor / files / HUD.gd

Branch meteor · default branch · all branches

HUD.gd

Blame: the commit that last changed each line · file · history

5b18ed86 2023-11-01 Pavel Safronov1extends Control
2
3export var score = 0
4
d5d1043b 2023-11-02 Pavel Safronov5func _ready() -> void:
6 $AnimationPlayer.play("instructions fade")
7
5b18ed86 2023-11-01 Pavel Safronov8func _process(_delta: float) -> void:
52220002 2023-11-06 Pavel Safronov9 $VBoxContainer/HBoxContainer2/HBoxContainer/Score.text = "%s" % score
10 if Input.is_action_just_pressed("exit"):
11 if OS.get_name() == "OSX":
12 get_tree().quit()
13 else:
14 restart()
15 if Input.is_action_just_pressed("restart"):
16 restart()
17
18func restart():
19 var _error = get_tree().reload_current_scene()
20 get_tree().paused = false