Teleport works, item pickup is broken
This commit is contained in:
@@ -28,8 +28,6 @@ namespace GameJamDungeon
|
||||
|
||||
[Node] public ISubViewport GameWindow { get; set; } = default!;
|
||||
|
||||
[Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
Instantiator = new Instantiator(GetTree());
|
||||
@@ -38,8 +36,6 @@ namespace GameJamDungeon
|
||||
AppLogic.Set(AppRepo);
|
||||
Menu.NewGame += OnNewGame;
|
||||
Menu.Quit += OnQuit;
|
||||
AppRepo.ShowLoadingScreen += OnShowLoadingScreen;
|
||||
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
|
||||
this.Provide();
|
||||
}
|
||||
|
||||
@@ -51,7 +47,6 @@ namespace GameJamDungeon
|
||||
.Handle((in AppLogic.Output.ShowLoadingScreen _) =>
|
||||
{
|
||||
Menu.Hide();
|
||||
AnimationPlayer.Play("load");
|
||||
})
|
||||
.Handle((in AppLogic.Output.SetupGameScene _) =>
|
||||
{
|
||||
@@ -70,19 +65,6 @@ namespace GameJamDungeon
|
||||
AppLogic.Start();
|
||||
}
|
||||
|
||||
private void OnShowLoadingScreen()
|
||||
{
|
||||
AnimationPlayer.Play("wait_and_load");
|
||||
}
|
||||
|
||||
private void AnimationPlayer_AnimationFinished(StringName animName)
|
||||
{
|
||||
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());
|
||||
|
||||
public void OnQuit() => AppLogic.Input(new AppLogic.Input.QuitGame());
|
||||
|
||||
@@ -1,86 +1,8 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cagfc5ridmteu"]
|
||||
[gd_scene load_steps=3 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"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_mbxap"]
|
||||
length = 0.001
|
||||
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),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("SubViewportContainer:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_fa8xf"]
|
||||
resource_name = "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, 0.466667, 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)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("SubViewportContainer:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 4.03333),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"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"),
|
||||
"wait_and_load": SubResource("Animation_r1pq3")
|
||||
}
|
||||
|
||||
[node name="App" type="CanvasLayer"]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_rt73h")
|
||||
@@ -99,22 +21,7 @@ transparent_bg = true
|
||||
handle_input_locally = false
|
||||
audio_listener_enable_3d = true
|
||||
size = Vector2i(1920, 1080)
|
||||
render_target_update_mode = 0
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="Menu" parent="." instance=ExtResource("2_kvwo1")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="LoadScreen" type="ColorRect" parent="."]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.235294, 0.235294, 0.784314, 1)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_vkd35")
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ namespace GameJamDungeon
|
||||
|
||||
event Action? MainMenuEntered;
|
||||
|
||||
event Action? ShowLoadingScreen;
|
||||
|
||||
void SkipSplashScreen();
|
||||
|
||||
void OnMainMenuEntered();
|
||||
@@ -23,8 +21,6 @@ namespace GameJamDungeon
|
||||
void OnExitGame();
|
||||
|
||||
void OnGameOver();
|
||||
|
||||
void OnShowLoadingScreen();
|
||||
}
|
||||
|
||||
public class AppRepo : IAppRepo
|
||||
@@ -33,7 +29,6 @@ namespace GameJamDungeon
|
||||
public event Action? MainMenuEntered;
|
||||
public event Action? GameEntered;
|
||||
public event Action? GameExited;
|
||||
public event Action? ShowLoadingScreen;
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
@@ -47,8 +42,6 @@ namespace GameJamDungeon
|
||||
|
||||
public void OnGameOver() => GameExited?.Invoke();
|
||||
|
||||
public void OnShowLoadingScreen() => ShowLoadingScreen?.Invoke();
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
@@ -60,7 +53,6 @@ namespace GameJamDungeon
|
||||
MainMenuEntered = null;
|
||||
GameEntered = null;
|
||||
GameExited = null;
|
||||
ShowLoadingScreen = null;
|
||||
}
|
||||
|
||||
_disposedValue = true;
|
||||
|
||||
Reference in New Issue
Block a user