public void LoadEasyMode(HUD hud) { var easyModeScene = (PackedScene)GD.Load("res://scenes/Easy.tscn"); var easyMode = easyModeScene.Instance(); hud.AddChild(easyMode); easyMode.GetNode <Path>("LeftPath").Connect("getScore", hud, nameof(_on_Path_getScore)); easyMode.GetNode <Path>("RightPath").Connect("getScore", hud, nameof(_on_Path_getScore)); easyMode.GetNode <Path>("LeftPath").Connect("die", hud, nameof(_on_Path_die)); easyMode.GetNode <Path>("RightPath").Connect("die", hud, nameof(_on_Path_die)); }
public void LoadHardMode(HUD hud) { var hardModeScene = (PackedScene)GD.Load("res://scenes/Hard.tscn"); var hardMode = hardModeScene.Instance(); hud.AddChild(hardMode); hardMode.GetNode <Path>("LeftPath").Connect("getScore", hud, nameof(_on_Path_getScore)); hardMode.GetNode <Path>("RightPath").Connect("getScore", hud, nameof(_on_Path_getScore)); hardMode.GetNode <Path>("MiddlePath1").Connect("getScore", hud, nameof(_on_Path_getScore)); hardMode.GetNode <Path>("MiddlePath2").Connect("getScore", hud, nameof(_on_Path_getScore)); hardMode.GetNode <Path>("LeftPath").Connect("die", hud, nameof(_on_Path_die)); hardMode.GetNode <Path>("RightPath").Connect("die", hud, nameof(_on_Path_die)); hardMode.GetNode <Path>("MiddlePath1").Connect("die", hud, nameof(_on_Path_die)); hardMode.GetNode <Path>("MiddlePath2").Connect("die", hud, nameof(_on_Path_die)); }