Trying teleport again
This commit is contained in:
@@ -38,6 +38,7 @@ namespace GameJamDungeon
|
||||
AppLogic.Set(AppRepo);
|
||||
Menu.NewGame += OnNewGame;
|
||||
Menu.Quit += OnQuit;
|
||||
AppRepo.ShowLoadingScreen += OnShowLoadingScreen;
|
||||
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
|
||||
this.Provide();
|
||||
}
|
||||
@@ -69,9 +70,17 @@ namespace GameJamDungeon
|
||||
AppLogic.Start();
|
||||
}
|
||||
|
||||
private void OnShowLoadingScreen()
|
||||
{
|
||||
AnimationPlayer.Play("wait_and_load");
|
||||
}
|
||||
|
||||
private void AnimationPlayer_AnimationFinished(StringName animName)
|
||||
{
|
||||
AppLogic.Input(new AppLogic.Input.LoadGameFinished());
|
||||
if (animName == "wait_and_load")
|
||||
Instantiator.SceneTree.Paused = false;
|
||||
else if (animName == "load")
|
||||
AppLogic.Input(new AppLogic.Input.LoadGameFinished());
|
||||
}
|
||||
|
||||
public void OnNewGame() => AppLogic.Input(new AppLogic.Input.NewGame());
|
||||
|
||||
@@ -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"]
|
||||
@@ -58,10 +58,27 @@ tracks/1/keys = {
|
||||
"values": [false, true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_r1pq3"]
|
||||
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(0.966667, 2.03333, 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_r1pq3")
|
||||
}
|
||||
|
||||
[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
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace GameJamDungeon
|
||||
|
||||
event Action? MainMenuEntered;
|
||||
|
||||
event Action? ShowLoadingScreen;
|
||||
|
||||
void SkipSplashScreen();
|
||||
|
||||
void OnMainMenuEntered();
|
||||
@@ -21,6 +23,8 @@ namespace GameJamDungeon
|
||||
void OnExitGame();
|
||||
|
||||
void OnGameOver();
|
||||
|
||||
void OnShowLoadingScreen();
|
||||
}
|
||||
|
||||
public class AppRepo : IAppRepo
|
||||
@@ -29,6 +33,7 @@ namespace GameJamDungeon
|
||||
public event Action? MainMenuEntered;
|
||||
public event Action? GameEntered;
|
||||
public event Action? GameExited;
|
||||
public event Action? ShowLoadingScreen;
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
@@ -42,6 +47,8 @@ namespace GameJamDungeon
|
||||
|
||||
public void OnGameOver() => GameExited?.Invoke();
|
||||
|
||||
public void OnShowLoadingScreen() => ShowLoadingScreen?.Invoke();
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
@@ -53,6 +60,7 @@ namespace GameJamDungeon
|
||||
MainMenuEntered = null;
|
||||
GameEntered = null;
|
||||
GameExited = null;
|
||||
ShowLoadingScreen = null;
|
||||
}
|
||||
|
||||
_disposedValue = true;
|
||||
|
||||
Reference in New Issue
Block a user