project_teddy/scripts/mainmenu.gd

39 lines
924 B
GDScript3
Raw Normal View History

2023-01-24 13:33:37 -07:00
extends Control
2023-01-26 13:23:13 -07:00
2023-01-24 13:33:37 -07:00
func _ready():
2023-01-26 13:23:13 -07:00
if Global.playingGame == true:
$Button.text = "RESUME"
$Button4.text = "MAIN MENU"
2023-01-24 13:33:37 -07:00
func _process(delta):
pass
func _on_button_pressed():
2023-01-26 13:23:13 -07:00
if Global.playingGame == false:
get_tree().change_scene_to_file("res://scenes/playground.tscn")
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
elif Global.playingGame == true:
self.queue_free()
Global.menuOpen = false
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
2023-01-26 12:17:54 -07:00
func _on_button_2_pressed():
var scene_trs =load("res://scenes/settings.tscn")
2023-01-24 13:33:37 -07:00
var scene=scene_trs.instantiate()
add_child(scene)
2023-01-26 12:17:54 -07:00
func _on_button_3_pressed():
get_tree().quit()
func _on_button_4_pressed():
if Global.playingGame == false:
get_tree().change_scene_to_file("res://scenes/multiplayer.tscn")
if Global.playingGame == true:
Global.playingGame = false
Global.menuOpen = false
get_tree().change_scene_to_file("res://scenes/mainmenu.tscn")