From e7729bc1c1b1ad05b684a05052adf264806b44ee Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 20 Feb 2025 11:10:28 +0100 Subject: [PATCH] Teleporter invisible mode --- Scenes/test.tscn | 19 +++++++++++++++++++ Scripts/Activables/Teleporter.cs | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/Scenes/test.tscn b/Scenes/test.tscn index 53f7b1f7..7defa172 100644 --- a/Scenes/test.tscn +++ b/Scenes/test.tscn @@ -217,6 +217,19 @@ position = Vector2(-767, -412) [node name="HealthStation" parent="Factory Tilemaps/Debug Room" instance=ExtResource("38_kuhg5")] position = Vector2(-680, -360) +[node name="BossDebugTeleporterSource" parent="Factory Tilemaps/Debug Room" node_paths=PackedStringArray("Target") instance=ExtResource("30_8fdby")] +position = Vector2(-826, -455) +IsEnabled = true +Target = NodePath("../../BossDebugTeleporterDestination") + +[node name="Label" type="Label" parent="Factory Tilemaps/Debug Room/BossDebugTeleporterSource"] +z_index = 2 +offset_left = -17.0 +offset_top = -23.0 +offset_right = 23.0 +text = "Boss Test" +label_settings = ExtResource("14_c4c20") + [node name="LargeTank" parent="Factory Tilemaps" instance=ExtResource("6_nkauc")] position = Vector2(-640, 54) @@ -322,6 +335,12 @@ position = Vector2(-1509, -256) IsEnabled = true Target = NodePath("../Teleporter7") +[node name="BossDebugTeleporterDestination" parent="Factory Tilemaps" node_paths=PackedStringArray("Target") instance=ExtResource("30_8fdby")] +position = Vector2(-1489, -345) +IsEnabled = true +Invisible = true +Target = NodePath("../Teleporter7") + [node name="Teleporter6" parent="Factory Tilemaps" node_paths=PackedStringArray("Target") instance=ExtResource("30_8fdby")] position = Vector2(-808, -439) IsEnabled = true diff --git a/Scripts/Activables/Teleporter.cs b/Scripts/Activables/Teleporter.cs index 6bec971e..d86a1c20 100644 --- a/Scripts/Activables/Teleporter.cs +++ b/Scripts/Activables/Teleporter.cs @@ -9,6 +9,9 @@ public partial class Teleporter : Activable { [Export] public bool IsEnabled { get; set; } + + [Export] + public bool Invisible { get; private set; } = false; public bool IsPrimed { get; private set; } @@ -39,6 +42,8 @@ public partial class Teleporter : Activable _particles.Emitting = false; _particleTimer = 0; + this.Visible = !Invisible; + if (IsEnabled) { _animatedSprite.Play("Active");