First_Person_Slapper/Start.gd

43 lines
954 B
GDScript3
Raw Normal View History

2022-10-11 14:32:39 -04:00
extends Control
var ingame = false
onready var NewGame = $"New Game"
onready var QuitGame = $"Quit Game"
onready var QuitDesktop = $"Quit to Desktop"
2022-10-12 08:22:40 -04:00
onready var MMusic = $"MenuMusic"
2022-10-11 14:32:39 -04:00
func _ready():
2022-10-12 08:22:40 -04:00
MMusic.play()
get_parent().show()
2022-10-11 14:32:39 -04:00
get_tree().paused = true
QuitGame.hide()
QuitDesktop.margin_top -= 44
QuitDesktop.margin_bottom -= 44
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func _on_Quit_to_Desktop_Button_pressed():
get_tree().quit()
func _on_New_Game_pressed():
2022-10-12 08:22:40 -04:00
get_parent().hide()
2022-10-11 14:32:39 -04:00
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
get_tree().paused = false
ingame = true
2022-10-12 08:22:40 -04:00
MMusic.stop()
2022-10-11 14:32:39 -04:00
func openMenu():
if (ingame):
NewGame.set_text("Continue Game")
QuitGame.show();
2022-10-11 14:57:56 -04:00
QuitDesktop.margin_top = 664
QuitDesktop.margin_bottom = 708
2022-10-11 14:32:39 -04:00
2022-10-12 08:22:40 -04:00
get_parent().show()
2022-10-11 14:32:39 -04:00
get_tree().paused = true
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func _on_Quit_Game_pressed():
get_tree().reload_current_scene()
2022-10-12 08:22:40 -04:00
get_tree().paused = true