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

14 lines
532 B
GDScript

extends Control
func _ready():
get_node("labelNiveauMax").set_text(str(global.monde))
get_node("labelEnnemisTues").set_text(str(global.ennemisTues))
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