DuckRun/code/GUI/restartschild.gd
megamichi 45193fc27f - adding coins
- performance improvements
- shake effect
- keyboard support
2024-11-04 19:10:10 +01:00

34 lines
811 B
GDScript

extends TextureRect
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$AnimationPlayer.play_backwards("out-in")
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")
$"../../Audio/GameOver".play()
$"../../Audio/Gui-in".play()
show()
$Restart.grab_focus()
print($"/root/Global".hiscore)
if %ScoreContainer.get_score() > $"/root/Global".hiscore:
$"/root/Global".write_save()
func _on_restart_pressed() -> void:
$"../..".start_game()
$AnimationPlayer.play("out-in")
$"../../Audio/Gui-out".play()
await $AnimationPlayer.animation_finished
hide()
func _on_back_pressed() -> void:
$"/root/Global".reset_game()