extends Control onready var mainMenu := $'%mainMenu' onready var optionPanel := $'%OptionPanel' const touchGamePath := 'res://scenes/RadialGame.tscn' const stepGamePath := 'res://scenes/StepGame.tscn' const touchGameScene := preload(touchGamePath) const stepGameScene := preload(stepGamePath) const SettingsMenu := preload('res://scenes/SettingsMenu.tscn') var activeGame: Node = null func exit_mode() -> void: remove_child(activeGame) activeGame = null mainMenu.show() optionPanel.show() func _on_MainMenu_start_stepgame() -> void: mainMenu.hide() activeGame = stepGameScene.instance() activeGame.connect('exit_mode', self, 'exit_mode') add_child_below_node(mainMenu, activeGame) func _on_MainMenu_start_touchgame() -> void: mainMenu.hide() activeGame = touchGameScene.instance() activeGame.connect('exit_mode', self, 'exit_mode') add_child_below_node(mainMenu, activeGame) activeGame.alignment_horizontal = AspectRatioContainer.ALIGN_BEGIN 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)