Game saving and loading

This commit is contained in:
Marco 2025-04-04 10:40:02 +02:00
commit 73b0847948
9 changed files with 83 additions and 26 deletions

View file

@ -50,11 +50,19 @@ public partial class MainMenu : CanvasLayer
private void _on_start_button_pressed()
{
if (GameScene != null)
if (GameScene == null) return;
GlobalState.Session.NewSession();
GlobalState.Session.AllowSaving = true;
GlobalState.Instance.GotoScene(GameScene);
//GetTree().ChangeSceneToFile(GameScene);
}
private void OnContinuePressed()
{
if (GameScene == null) return;
if (GlobalState.Instance.LoadGame())
{
GlobalState.Session.NewSession();
GlobalState.Instance.GotoScene(GameScene);
//GetTree().ChangeSceneToFile(GameScene);
GlobalState.Session.AllowSaving = true;
}
}