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/menuPrincipal.gd
2021-04-08 03:02:23 +02:00

18 lines
725 B
GDScript

extends Node2D
func _ready(): # focus par défaut le bouton JOUER
$MarginContainer/VBoxContainer/VBoxContainer/Jouer.grab_focus()
func _physics_process(_delta): # gestion de la souris
if $MarginContainer/VBoxContainer/VBoxContainer/Jouer.is_hovered() == true:
$MarginContainer/VBoxContainer/VBoxContainer/Jouer.grab_focus()
if $MarginContainer/VBoxContainer/VBoxContainer/Quitter.is_hovered() == true:
$MarginContainer/VBoxContainer/VBoxContainer/Quitter.grab_focus()
func _on_Jouer_pressed():
if get_tree().change_scene("res://scenes/Monde1.tscn") != OK: # on charge le monde
print("Impossible de charger le jeu.") # si le monde n'a pas chargé
func _on_Quitter_pressed():
get_tree().quit() # quitte le jeu