godot-shooter / meteor / files / HUD.gd
Branch meteor · default branch · all branches
HUD.gd
5b18ed86 2023-11-01 Pavel Safronov | 1 | extends Control |
| 2 | ||
| 3 | export var score = 0 | |
| 4 | ||
d5d1043b 2023-11-02 Pavel Safronov | 5 | func _ready() -> void: |
| 6 | $AnimationPlayer.play("instructions fade") | |
| 7 | ||
5b18ed86 2023-11-01 Pavel Safronov | 8 | func _process(_delta: float) -> void: |
52220002 2023-11-06 Pavel Safronov | 9 | $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 | ||
| 18 | func restart(): | |
| 19 | var _error = get_tree().reload_current_scene() | |
| 20 | get_tree().paused = false |