For now, go straight to instantiating the scene instead of the main menu/loading screen

This commit is contained in:
2024-09-04 13:11:37 -07:00
parent b21bcf0573
commit 18a6d5a0b7
4 changed files with 33 additions and 3 deletions

View File

@@ -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>(GAME_SCENE_PATH);
GameWindow.AddChildEx(Game);

View File

@@ -9,6 +9,6 @@ namespace GameJamDungeon
[LogicBlock(typeof(State), Diagram = true)]
public partial class AppLogic : LogicBlock<AppLogic.State>, IAppLogic
{
public override Transition GetInitialState() => To<State.MainMenu>();
public override Transition GetInitialState() => To<State.SetupGameScene>();
}
}

View File

@@ -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<Input.LoadGameFinished>
{
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<InGame>();
}
}
}
}
}

View File

@@ -60,7 +60,7 @@ public class GameRepo : IGameRepo
{
_inventoryItems = new AutoProp<List<InventoryItemInfo>>([]);
_isInventoryScreenOpened = new AutoProp<bool>(false);
_isPaused = new AutoProp<bool>(true);
_isPaused = new AutoProp<bool>(false);
_playerGlobalPosition = new AutoProp<Vector3>(Vector3.Zero);
_equippedWeapon = new Weapon();
HPBarValue = new AutoProp<int>(0);