This repository has been archived on 2022-03-31. You can view files and clone it, but cannot push or open issues or pull requests.
Tyra/scripts/GameOver.gd

15 lines
532 B
GDScript3
Raw Permalink Normal View History

2021-04-08 13:25:25 +02:00
extends Control
func _ready():
2021-04-08 15:15:37 +02:00
get_node("labelNiveauMax").set_text(str(global.monde))
get_node("labelEnnemisTues").set_text(str(global.ennemisTues))
2021-04-08 13:25:25 +02:00
var timer = Timer.new()
timer.connect("timeout", self, "_on_timer_timeout")
timer.set_wait_time(2) # 2 secondes
add_child(timer) # Ajout un timer
timer.start() # Lance le timer
func _on_timer_timeout():
if get_tree().change_scene("res://scenes/Menu.tscn") != OK: # recommence au début
print("Une erreur est survenue lors du rechargement de la scène.") # gestion erreur