2021-11-27 16:51:59 +10:30
|
|
|
extends Control
|
2024-03-23 19:41:34 +10:30
|
|
|
onready var mainMenu := $'%mainMenu'
|
2024-11-04 01:10:35 +10:30
|
|
|
onready var optionPanel := $'%OptionPanel'
|
2021-11-27 16:51:59 +10:30
|
|
|
|
2024-03-22 21:27:13 +10:30
|
|
|
const touchGamePath := 'res://scenes/RadialGame.tscn'
|
|
|
|
const stepGamePath := 'res://scenes/StepGame.tscn'
|
2024-11-04 01:10:35 +10:30
|
|
|
const touchGameScene := preload(touchGamePath)
|
|
|
|
const stepGameScene := preload(stepGamePath)
|
|
|
|
const SettingsMenu := preload('res://scenes/SettingsMenu.tscn')
|
2021-11-27 16:51:59 +10:30
|
|
|
|
2024-03-22 21:27:13 +10:30
|
|
|
var activeGame: Node = null
|
2021-11-27 16:51:59 +10:30
|
|
|
|
2024-11-04 01:10:35 +10:30
|
|
|
func exit_mode() -> void:
|
|
|
|
remove_child(activeGame)
|
|
|
|
activeGame = null
|
|
|
|
mainMenu.show()
|
|
|
|
optionPanel.show()
|
|
|
|
|
|
|
|
|
2021-11-27 16:51:59 +10:30
|
|
|
func _on_MainMenu_start_stepgame() -> void:
|
2024-03-22 21:27:13 +10:30
|
|
|
mainMenu.hide()
|
|
|
|
activeGame = stepGameScene.instance()
|
2024-11-04 01:10:35 +10:30
|
|
|
activeGame.connect('exit_mode', self, 'exit_mode')
|
2024-03-22 21:27:13 +10:30
|
|
|
add_child_below_node(mainMenu, activeGame)
|
2021-11-27 16:51:59 +10:30
|
|
|
|
|
|
|
|
|
|
|
func _on_MainMenu_start_touchgame() -> void:
|
2024-03-22 21:27:13 +10:30
|
|
|
mainMenu.hide()
|
|
|
|
activeGame = touchGameScene.instance()
|
2024-11-04 01:10:35 +10:30
|
|
|
activeGame.connect('exit_mode', self, 'exit_mode')
|
2024-03-22 21:27:13 +10:30
|
|
|
add_child_below_node(mainMenu, activeGame)
|
|
|
|
activeGame.alignment_horizontal = AspectRatioContainer.ALIGN_BEGIN
|
2024-11-04 01:10:35 +10:30
|
|
|
|
|
|
|
|
|
|
|
func _on_mainMenu_open_settings():
|
|
|
|
mainMenu.hide()
|
|
|
|
optionPanel.hide()
|
|
|
|
activeGame = SettingsMenu.instance()
|
|
|
|
activeGame.connect('exit_mode', self, 'exit_mode')
|
|
|
|
add_child_below_node(mainMenu, activeGame)
|