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

13 lines
412 B
GDScript3
Raw Normal View History

2021-04-08 13:25:25 +02:00
extends Control
func _ready():
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