123456789101112131415161718 |
- extends Node2D
- @onready var health_bar = $HealthBar
- @onready var transition = $Overlay/Transition
- var direction = -1
- func _ready() -> void:
- transition.slide_out()
- func _process(_delta: float) -> void:
- if Input.is_action_pressed("ui_cancel"):
- get_tree().change_scene_to_file("res://screens/main_menu.tscn")
- func _on_timer_timeout():
- health_bar.health += direction
- if health_bar.health == 0 || health_bar.health == health_bar.MAX_HEALTH:
- direction *= -1
|