Update node paths and group assignments for consistency across scenes
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACanvasItem_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fef7b819b226fab796d1dfe66d415dd7510bcac87675020ddb8f03a828e763_003FCanvasItem_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACollisionShape2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F2ca9b7334678f5c97c7c2a9fbe4837be71cae11b6a30408dd4791b18f997e4a_003FCollisionShape2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADelegateUtils_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F94701b444afa4c3d9a7a53ebcaa35fd1583c00_003F08_003F45f75e10_003FDelegateUtils_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F94701b444afa4c3d9a7a53ebcaa35fd1583c00_003F47_003Fda1d8d31_003FDictionary_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMr_002EBrickAdventures_002Escripts_002Ecomponents_002ECollectableComponent_005FScriptSignals_002Egenerated_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F80d9408eb7280c15eb4a12b61cdf8f7f1b0c5a2_003FMr_002EBrickAdventures_002Escripts_002Ecomponents_002ECollectableComponent_005FScriptSignals_002Egenerated_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F86db9cd834346aad02d74c1b66dd9c64d6ef3147435dd9c9c9477b48f7_003FNode2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARectangleShape2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fa1cc98873548652da0c14ecefa4737431426fcbb24a7f0641e3d9c266c3_003FRectangleShape2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
@@ -12,7 +12,7 @@
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dj5g5"]
|
||||
size = Vector2(10, 20)
|
||||
|
||||
[node name="Child" type="Area2D"]
|
||||
[node name="Child" type="Area2D" groups=["Collectables"]]
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
|
||||
|
@@ -37,7 +37,7 @@ script = ExtResource("2_jmsgb")
|
||||
ToCollapseTimer = NodePath("../ToCollapseTimer")
|
||||
ResetTimer = NodePath("../ResetTimer")
|
||||
Sprite2D = NodePath("../Sprite2D")
|
||||
CollisionShape = NodePath("../Collapsable detector/AreaCollisionShape2D")
|
||||
CollisionShape = NodePath("../StaticCollisionShape2D")
|
||||
ResetTime = 1.0
|
||||
|
||||
[connection signal="body_entered" from="Collapsable detector" to="CollapsableComponent" method="OnCollapsableDetectorBodyEntered"]
|
||||
|
@@ -39,7 +39,7 @@ script = ExtResource("2_w33sr")
|
||||
ToCollapseTimer = NodePath("../ToCollapseTimer")
|
||||
ResetTimer = NodePath("../ResetTimer")
|
||||
Sprite2D = NodePath("../Sprite2D")
|
||||
CollisionShape = NodePath("../Collapsable detector/AreaCollisionShape2D")
|
||||
CollisionShape = NodePath("../StaticCollisionShape2D")
|
||||
CollapseTime = 0.75
|
||||
ResetTime = 3.0
|
||||
|
||||
|
@@ -39,5 +39,5 @@ metadata/_custom_type_script = "uid://c8xhgkg8gcqu6"
|
||||
script = ExtResource("4_06sog")
|
||||
ExitArea = NodePath("..")
|
||||
DoorSprite = NodePath("../Sprite2D")
|
||||
OpenedDoorFrame = 1
|
||||
OpenedDoorFrame = 88
|
||||
metadata/_custom_type_script = "uid://bwamqffvpa452"
|
||||
|
@@ -73,6 +73,7 @@ enabled=PackedStringArray("res://addons/console/plugin.cfg", "res://addons/phant
|
||||
coins=""
|
||||
levers=""
|
||||
player=""
|
||||
Collectables=""
|
||||
|
||||
[gui]
|
||||
|
||||
|
@@ -35,7 +35,7 @@ public partial class ExitDoorComponent : Node, IUnlockable
|
||||
if (Locked) return;
|
||||
|
||||
EmitSignalExitTriggered();
|
||||
_gameManager.UnlockLevel((int)_gameManager.PlayerState["CurrentLevel"] + 1);
|
||||
_gameManager.UnlockLevel((int)_gameManager.PlayerState["current_level"] + 1);
|
||||
CallDeferred(nameof(GoToNextLevel));
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@ namespace Mr.BrickAdventures.scripts.components;
|
||||
public partial class ScoreComponent : Node
|
||||
{
|
||||
private GameManager _gameManager;
|
||||
private const string CoinsGroupName = "Coins";
|
||||
private const string CoinsGroupName = "coins";
|
||||
|
||||
public override async void _Ready()
|
||||
{
|
||||
@@ -20,30 +20,17 @@ public partial class ScoreComponent : Node
|
||||
return;
|
||||
}
|
||||
|
||||
var coins = GetTree().GetNodesInGroup("coins");
|
||||
GD.Print($"Found {coins.Count} coins in the scene.");
|
||||
var coins = GetTree().GetNodesInGroup(CoinsGroupName);
|
||||
foreach (var coin in coins)
|
||||
{
|
||||
var c = coin.GetNodeOrNull<CollectableComponent>("CollectableComponent");
|
||||
GD.Print(c == null ? "CollectableComponent not found on coin." : "CollectableComponent found on coin.");
|
||||
if (c != null)
|
||||
{
|
||||
c.Collected += OnCollected;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
GetCoinsInScene();
|
||||
}
|
||||
|
||||
private void GetCoinsInScene()
|
||||
{
|
||||
var coins = GetTree().GetNodesInGroup("Coins");
|
||||
GD.Print($"Found {coins.Count} coins in the scene.");
|
||||
}
|
||||
|
||||
|
||||
private void OnCollected(float amount, CollectableType type, Node2D body)
|
||||
{
|
||||
if (type != CollectableType.Coin) return;
|
||||
|
Reference in New Issue
Block a user