DuckRun/code/GUI/restartschild.gd
2024-10-03 21:12:20 +02:00

24 lines
493 B
GDScript

extends TextureRect
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#global_position.y = -80
hide()
func _process(_delta: float) -> void:
pass
#global_position.x = get_viewport().get_visible_rect().size.x * 0.5
func _on_duck_gameover() -> void:
$AnimationPlayer.play_backwards("out-in")
show()
func _on_restart_pressed() -> void:
$"../..".start_game()
$AnimationPlayer.play("out-in")
await $AnimationPlayer.animation_finished
hide()