summaryrefslogtreecommitdiff
path: root/scripts/GameManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/GameManager.cs')
-rw-r--r--scripts/GameManager.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/GameManager.cs b/scripts/GameManager.cs
index df93954..4215475 100644
--- a/scripts/GameManager.cs
+++ b/scripts/GameManager.cs
@@ -10,6 +10,7 @@ public partial class GameManager : Node
private PackedScene mainMenuScene = GD.Load<PackedScene>("res://scenes/GUI/main_menu.tscn");
private PackedScene gameScene = GD.Load<PackedScene>("res://scenes/Game.tscn");
private PackedScene nameScene = GD.Load<PackedScene>("res://scenes/name_thyself.tscn");
+ private PackedScene leaderboardScene = GD.Load<PackedScene>("res://scenes/GUI/Leaderboard.tscn");
private Node currentScene;
@@ -44,6 +45,7 @@ public partial class GameManager : Node
MainMenu menu = (MainMenu)SwitchToScene(mainMenuScene);
Stats.Instance.Clear();
menu.GameRequest += OnGameRequest;
+ menu.LeaderboardRequest += OnLeaderboardRequest;
}
private void LoadGame()
@@ -88,4 +90,10 @@ public partial class GameManager : Node
LoadGame();
}
}
+
+ private void OnLeaderboardRequest()
+ {
+ Leaderboard scene = (Leaderboard)SwitchToScene(leaderboardScene);
+ scene.MenuRequested += LoadMainMenu;
+ }
}