RhythmGame/main.gd

23 lines
686 B
GDScript

extends Control
export var mainMenuPath := @'MainMenu'
onready var mainMenu := get_node(mainMenuPath)
const touchGamePath := 'res://scenes/RadialGame.tscn'
const stepGamePath := 'res://scenes/StepGame.tscn'
var touchGameScene := preload(touchGamePath)
var stepGameScene := preload(stepGamePath)
var activeGame: Node = null
func _on_MainMenu_start_stepgame() -> void:
mainMenu.hide()
activeGame = stepGameScene.instance()
add_child_below_node(mainMenu, activeGame)
func _on_MainMenu_start_touchgame() -> void:
mainMenu.hide()
activeGame = touchGameScene.instance()
add_child_below_node(mainMenu, activeGame)
activeGame.alignment_horizontal = AspectRatioContainer.ALIGN_BEGIN