Make basic overworld and teleport to first dungeon floor

This commit is contained in:
2024-09-07 03:31:42 -07:00
parent 98d096303c
commit 3665150342
10 changed files with 141 additions and 102 deletions

View File

@@ -38,10 +38,17 @@ namespace GameJamDungeon
AppLogic.Set(AppRepo);
Menu.NewGame += OnNewGame;
Menu.Quit += OnQuit;
AppRepo.ShowLoadingScreen += AppRepo_ShowLoadingScreen;
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
this.Provide();
}
private void AppRepo_ShowLoadingScreen()
{
AnimationPlayer.Play("wait_and_load");
}
public void OnReady()
{
AppBinding = AppLogic.Bind();
@@ -71,7 +78,8 @@ namespace GameJamDungeon
private void AnimationPlayer_AnimationFinished(StringName animName)
{
AppLogic.Input(new AppLogic.Input.LoadGameFinished());
Instantiator.SceneTree.Paused = false;
//AppLogic.Input(new AppLogic.Input.LoadGameFinished());
}
public void OnNewGame() => AppLogic.Input(new AppLogic.Input.NewGame());

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=6 format=3 uid="uid://cagfc5ridmteu"]
[gd_scene load_steps=7 format=3 uid="uid://cagfc5ridmteu"]
[ext_resource type="Script" path="res://src/app/App.cs" id="1_rt73h"]
[ext_resource type="PackedScene" uid="uid://rfvnddfqufho" path="res://src/menu/Menu.tscn" id="2_kvwo1"]
@@ -40,7 +40,7 @@ tracks/0/path = NodePath("LoadScreen:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.466667, 4.03333, 5),
"times": PackedFloat32Array(0, 1.93333, 4.03333, 5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1), Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
@@ -58,10 +58,27 @@ tracks/1/keys = {
"values": [false, true]
}
[sub_resource type="Animation" id="Animation_bvk81"]
resource_name = "wait_and_load"
length = 5.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("LoadScreen:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(1.03333, 1.93333, 4.03333, 5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1), Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_vkd35"]
_data = {
"RESET": SubResource("Animation_mbxap"),
"load": SubResource("Animation_fa8xf")
"load": SubResource("Animation_fa8xf"),
"wait_and_load": SubResource("Animation_bvk81")
}
[node name="App" type="CanvasLayer"]
@@ -82,7 +99,7 @@ transparent_bg = true
handle_input_locally = false
audio_listener_enable_3d = true
size = Vector2i(1920, 1080)
render_target_update_mode = 4
render_target_update_mode = 0
[node name="Menu" parent="." instance=ExtResource("2_kvwo1")]
unique_name_in_owner = true

View File

@@ -12,6 +12,8 @@ namespace GameJamDungeon
event Action? MainMenuEntered;
event Action? ShowLoadingScreen;
void SkipSplashScreen();
void OnMainMenuEntered();
@@ -21,6 +23,9 @@ namespace GameJamDungeon
void OnExitGame();
void OnGameOver();
void OnShowLoadingScreen();
}
public class AppRepo : IAppRepo
@@ -29,6 +34,7 @@ namespace GameJamDungeon
public event Action? MainMenuEntered;
public event Action? GameEntered;
public event Action? GameExited;
public event Action? ShowLoadingScreen;
private bool _disposedValue;
@@ -42,6 +48,8 @@ namespace GameJamDungeon
public void OnGameOver() => GameExited?.Invoke();
public void OnShowLoadingScreen() => ShowLoadingScreen?.Invoke();
protected void Dispose(bool disposing)
{
if (!_disposedValue)
@@ -53,6 +61,7 @@ namespace GameJamDungeon
MainMenuEntered = null;
GameEntered = null;
GameExited = null;
ShowLoadingScreen = null;
}
_disposedValue = true;