123456789101112131415161718192021222324 |
- 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"):
- var tree = get_tree()
- transition.text = ""
- transition.slide_in()
- await transition.game_fully_hidden
- tree.paused = true
- tree.change_scene_to_file("res://screens/main_menu.tscn")
- tree.paused = false
- func _on_timer_timeout():
- health_bar.health += direction
- if health_bar.health == 0 || health_bar.health == health_bar.MAX_HEALTH:
- direction *= -1
|