diff --git a/src/app/App.cs b/src/app/App.cs index cc421c37..03995f7a 100644 --- a/src/app/App.cs +++ b/src/app/App.cs @@ -2,7 +2,6 @@ using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; using Godot; -using System.Threading; namespace GameJamDungeon { @@ -55,6 +54,7 @@ namespace GameJamDungeon }) .Handle((in AppLogic.Output.SetupGameScene _) => { + Menu.Hide(); Instantiator.SceneTree.Paused = true; Game = Instantiator.LoadAndInstantiate(GAME_SCENE_PATH); GameWindow.AddChildEx(Game); diff --git a/src/app/state/AppLogic.cs b/src/app/state/AppLogic.cs index 94ebbd94..a227bf20 100644 --- a/src/app/state/AppLogic.cs +++ b/src/app/state/AppLogic.cs @@ -9,6 +9,6 @@ namespace GameJamDungeon [LogicBlock(typeof(State), Diagram = true)] public partial class AppLogic : LogicBlock, IAppLogic { - public override Transition GetInitialState() => To(); + public override Transition GetInitialState() => To(); } } diff --git a/src/app/state/states/AppLogic.State.SetupGameScene.cs b/src/app/state/states/AppLogic.State.SetupGameScene.cs new file mode 100644 index 00000000..78717fdd --- /dev/null +++ b/src/app/state/states/AppLogic.State.SetupGameScene.cs @@ -0,0 +1,30 @@ +using Chickensoft.Introspection; +using Chickensoft.LogicBlocks; + +namespace GameJamDungeon +{ + public partial class AppLogic + { + public partial record State + { + [Meta] + public partial record SetupGameScene : State, IGet + { + public SetupGameScene() + { + this.OnEnter(() => + { + Output(new Output.SetupGameScene()); + Output(new Output.ShowGame()); + Input(new Input.LoadGameFinished()); + }); + } + + public Transition On(in Input.LoadGameFinished input) + { + return To(); + } + } + } + } +} diff --git a/src/game/IGameRepo.cs b/src/game/IGameRepo.cs index 36a905fa..968579ea 100644 --- a/src/game/IGameRepo.cs +++ b/src/game/IGameRepo.cs @@ -60,7 +60,7 @@ public class GameRepo : IGameRepo { _inventoryItems = new AutoProp>([]); _isInventoryScreenOpened = new AutoProp(false); - _isPaused = new AutoProp(true); + _isPaused = new AutoProp(false); _playerGlobalPosition = new AutoProp(Vector3.Zero); _equippedWeapon = new Weapon(); HPBarValue = new AutoProp(0);