fuzzyworld

godot-shooter / change-html-template / files / HUD.gd

Branch change-html-template · default branch · all branches

HUD.gd

463 B · history · blame

1extends Control
2
3export var score = 0
4
5func _ready() -> void:
6 $AnimationPlayer.play("instructions fade")
7
8func _process(_delta: float) -> void:
9 $VBoxContainer/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