Lightbridge collisions

This commit is contained in:
MaddoScientisto 2025-03-03 21:15:20 +01:00
commit c1b498fa82
4 changed files with 44 additions and 46 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://d0j1bmgbefyp2"]
[gd_scene load_steps=12 format=3 uid="uid://d0j1bmgbefyp2"]
[ext_resource type="Script" uid="uid://dwry0643yvdiv" path="res://Scripts/Door.cs" id="1_faieq"]
[ext_resource type="Shader" uid="uid://0ruey5bjl7mh" path="res://Shaders/Blink.gdshader" id="2_25105"]
@ -24,11 +24,8 @@ shader_parameter/scanline_density = 50.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0wg11"]
size = Vector2(32, 32)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hctcd"]
size = Vector2(21, 178)
[node name="LightBridge" type="Area2D" groups=["Solid"]]
collision_layer = 64
[node name="LightBridge" type="Area2D"]
collision_layer = 0
collision_mask = 154
script = ExtResource("1_faieq")
metadata/_edit_group_ = true
@ -44,8 +41,8 @@ TurnOffMaterial = SubResource("ShaderMaterial_25105")
ActiveMaterial = ExtResource("3_oo6b5")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." node_paths=PackedStringArray("_door")]
visible = false
shape = SubResource("RectangleShape2D_0wg11")
disabled = true
script = ExtResource("3_hctcd")
_door = NodePath("..")
@ -57,14 +54,3 @@ max_distance = 200.0
[node name="DeactivationSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("6_v0863")
max_distance = 200.0
[node name="AcidArea" type="Area2D" parent="." groups=["Acid"]]
collision_layer = 256
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="AcidArea" node_paths=PackedStringArray("_door")]
position = Vector2(-0.5, 0)
shape = SubResource("RectangleShape2D_hctcd")
script = ExtResource("3_hctcd")
_door = NodePath("../..")
Invert = true

View file

@ -36,7 +36,7 @@
[sub_resource type="Resource" id="Resource_6wo78"]
script = ExtResource("4_u1i8n")
EggIndex = 0
StartingEquipment = Array[ExtResource("5_u1i8n")]([])
StartingEquipment = []
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rff8l"]
size = Vector2(30, 52.5)
@ -57,7 +57,7 @@ PlayerTemplate = ExtResource("8_c3v4x")
SpawnMarkers = Dictionary[int, NodePath]({
0: NodePath("PlayerStartPosition")
})
StartingEquipment = Array[ExtResource("5_u1i8n")]([ExtResource("3_6314l"), ExtResource("4_yyg8m")])
StartingEquipment = [ExtResource("3_6314l"), ExtResource("4_yyg8m")]
MapStartData = SubResource("Resource_6wo78")
[node name="Tilemaps" type="Node2D" parent="."]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=105 format=4 uid="uid://bv451a8wgty4u"]
[gd_scene load_steps=108 format=4 uid="uid://bv451a8wgty4u"]
[ext_resource type="Script" uid="uid://doxmbokehw8ci" path="res://Scripts/GameManager.cs" id="1_8tmoj"]
[ext_resource type="PackedScene" uid="uid://c4pr2707hbeph" path="res://Scenes/Actors/fsm_player.tscn" id="2_ksslq"]
@ -79,6 +79,7 @@
[ext_resource type="PackedScene" uid="uid://dfat0erkvb513" path="res://Scenes/Actors/Fairy_New.tscn" id="73_s4x1s"]
[ext_resource type="PackedScene" uid="uid://c21m7w5ahpsd0" path="res://Scenes/Activable/Shroud.tscn" id="74_oaf68"]
[ext_resource type="PackedScene" uid="uid://d0j1bmgbefyp2" path="res://Scenes/Actors/Lightbridge.tscn" id="75_jn1m0"]
[ext_resource type="Script" uid="uid://crpkvxepkcrir" path="res://Scripts/Components/Actors/ForceFieldCollisionDisabler.cs" id="76_h0jm4"]
[ext_resource type="PackedScene" uid="uid://drdgcu2r3yrp7" path="res://Scenes/Interactable/control_pad_green_keycard.tscn" id="76_usuub"]
[ext_resource type="PackedScene" uid="uid://b3tyacxxw88lx" path="res://Scenes/Utils/StreamPlayerWithName.tscn" id="77_yot54"]
[ext_resource type="AudioStream" uid="uid://blohh20jktoyo" path="res://SFX/270641__phantastonia__alarm2.wav" id="79_jn1m0"]
@ -91,7 +92,10 @@ EggIndex = 0
StartingEquipment = Array[ExtResource("6_8tdlb")]([ExtResource("6_khabp")])
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ksslq"]
size = Vector2(183, 50.5)
size = Vector2(184, 46.5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_usuub"]
size = Vector2(184, 53.25)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jn1m0"]
size = Vector2(23, 22)
@ -191,6 +195,9 @@ script = ExtResource("49_0si7g")
Target = NodePath(".")
WaitForCompletion = true
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pniyx"]
size = Vector2(52, 184)
[node name="GameScene" type="Node2D"]
process_mode = 3
script = ExtResource("1_8tmoj")
@ -200,7 +207,7 @@ SpawnMarkers = Dictionary[int, NodePath]({
2: NodePath("Factory Tilemaps/LevelProps/BossDebugTeleporterDestination"),
255: NodePath("Factory Tilemaps/Debug Room/DebugRoomStartPosition")
})
StartingEquipment = Array[ExtResource("6_8tdlb")]([ExtResource("4_swym2"), ExtResource("5_nqier")])
StartingEquipment = [ExtResource("4_swym2"), ExtResource("5_nqier")]
MapStartData = SubResource("Resource_6sau4")
metadata/_edit_lock_ = true
@ -252,12 +259,12 @@ collision_layer = 256
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Factory Tilemaps/AcidHitboxes/Acid"]
position = Vector2(-1759, -689.25)
position = Vector2(-1760, -691.25)
shape = SubResource("RectangleShape2D_ksslq")
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Factory Tilemaps/AcidHitboxes/Acid"]
position = Vector2(-1761, -596)
shape = SubResource("RectangleShape2D_ksslq")
position = Vector2(-1760, -597.375)
shape = SubResource("RectangleShape2D_usuub")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Factory Tilemaps/AcidHitboxes/Acid"]
position = Vector2(-784, -448)
@ -904,21 +911,28 @@ position = Vector2(-1925, -709)
[node name="Turret362" parent="Factory Tilemaps/LevelProps" instance=ExtResource("62_h0jm4")]
position = Vector2(-1927, -586)
[node name="LightBridge" parent="Factory Tilemaps/LevelProps" instance=ExtResource("75_jn1m0")]
[node name="AcidBridge" type="Area2D" parent="Factory Tilemaps/LevelProps" groups=["Acid"]]
position = Vector2(-1760, -641)
rotation = 1.5708
State = 1
collision_layer = 256
collision_mask = 0
[node name="Sprite2D" parent="Factory Tilemaps/LevelProps/LightBridge" index="0"]
position = Vector2(-4.76837e-07, 0.182037)
scale = Vector2(0.125, -191.497)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Factory Tilemaps/LevelProps/AcidBridge" node_paths=PackedStringArray("_door")]
shape = SubResource("RectangleShape2D_pniyx")
script = ExtResource("76_h0jm4")
_door = NodePath("../LightBridge")
Invert = true
[node name="LightBridge" parent="Factory Tilemaps/LevelProps/AcidBridge" instance=ExtResource("75_jn1m0")]
scale = Vector2(1, 5.985)
State = 1
[node name="GreenKeyCard" parent="Factory Tilemaps/LevelProps" instance=ExtResource("36_f8fh1")]
position = Vector2(-1598, -628)
[node name="KeycardReaderGreen" parent="Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Targets") instance=ExtResource("76_usuub")]
position = Vector2(-1640, -619)
Targets = [NodePath("../LightBridge")]
Targets = [NodePath("../AcidBridge/LightBridge")]
[node name="Ammo1" parent="Factory Tilemaps" instance=ExtResource("34_17pjh")]
position = Vector2(-872, -220)
@ -962,5 +976,3 @@ AlarmSound = ExtResource("79_jn1m0")
process_mode = 3
autoplay = true
MusicData = ExtResource("82_ksslq")
[editable path="Factory Tilemaps/LevelProps/LightBridge"]

View file

@ -7,7 +7,7 @@ public partial class ForceField : Door
{
[Export]
public Material TurnOffMaterial { get; private set; }
[Export]
public Material ActiveMaterial { get; private set; }
@ -22,11 +22,11 @@ public partial class ForceField : Door
_ = AnimateShutdownAsync();
}
protected async Task AnimateShutdownAsync()
protected async Task AnimateShutdownAsync()
{
Tween tween = GetTree().CreateTween();
tween.TweenMethod(Callable.From((float value) => SetShaderScanlineDensity(value)), 0f, 50f, 0.5);
tween.Parallel().TweenMethod(Callable.From((float value) => SetShaderTeleportProgress(value)), 0f, 1f, 0.5);
tween.TweenMethod(Callable.From((float value) => SetShaderScanlineDensity(value)), 0f, 50f, 0.5);
tween.Parallel().TweenMethod(Callable.From((float value) => SetShaderTeleportProgress(value)), 0f, 1f, 0.5);
await ToSignal(tween, "finished");
}
@ -42,12 +42,12 @@ public partial class ForceField : Door
}
private void SetShaderTeleportProgress(float value)
{
//((ShaderMaterial)_animatedSprite.Material).SetShaderParameter("teleport_progress", value);
}
{
//((ShaderMaterial)_animatedSprite.Material).SetShaderParameter("teleport_progress", value);
}
private void SetShaderScanlineDensity(float value)
{
//((ShaderMaterial)_animatedSprite.Material).SetShaderParameter("scanline_density", value);
}
private void SetShaderScanlineDensity(float value)
{
//((ShaderMaterial)_animatedSprite.Material).SetShaderParameter("scanline_density", value);
}
}