From 20bf061045e5bc516352b118b4ea736f30e63142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=91=D0=B4=D0=BE=D1=80=20=D0=92=D0=B5=D1=81=D0=B5?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 14:52:20 +0500 Subject: [PATCH] Collision mask and potato mine explosion --- scenes/entities/plants/plant_template.tscn | 2 ++ scenes/entities/plants/potato_mine.tscn | 14 +++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/scenes/entities/plants/plant_template.tscn b/scenes/entities/plants/plant_template.tscn index f7d4e5e..14f0ad2 100644 --- a/scenes/entities/plants/plant_template.tscn +++ b/scenes/entities/plants/plant_template.tscn @@ -10,3 +10,5 @@ script = ExtResource("1_324sd") [node name="AnimationPlayer" type="AnimationPlayer" parent="."] [node name="Hitbox" type="Area2D" parent="."] +collision_layer = 2 +collision_mask = 0 diff --git a/scenes/entities/plants/potato_mine.tscn b/scenes/entities/plants/potato_mine.tscn index 8078e22..db7e721 100644 --- a/scenes/entities/plants/potato_mine.tscn +++ b/scenes/entities/plants/potato_mine.tscn @@ -108,10 +108,6 @@ libraries = { } autoplay = "idle_unprimed" -[node name="Hitbox" parent="." index="2"] -collision_layer = 2 -collision_mask = 0 - [node name="Unprimed" type="CollisionShape2D" parent="Hitbox" index="0"] position = Vector2(-0.5, 14.5) shape = SubResource("RectangleShape2D_qfqko") @@ -132,6 +128,7 @@ shape = SubResource("CircleShape2D_v0g5b") [node name="ExplosionBox" type="Area2D" parent="." index="4"] collision_layer = 0 collision_mask = 8 +script = ExtResource("3_2hd5y") [node name="CollisionShape2D" type="CollisionShape2D" parent="ExplosionBox" index="0"] position = Vector2(0, 9) @@ -142,12 +139,7 @@ wait_time = 15.0 one_shot = true autostart = true -[node name="Explosion" type="Node" parent="." index="6" node_paths=PackedStringArray("explosionArea")] -script = ExtResource("3_2hd5y") -damage = 60 -explosionArea = NodePath("../ExplosionBox") - -[node name="Behaviour" type="Node" parent="." index="7" node_paths=PackedStringArray("_player", "_hitbox", "_unprimedShape", "_primedShape")] +[node name="Behaviour" type="Node" parent="." index="6" node_paths=PackedStringArray("_player", "_hitbox", "_unprimedShape", "_primedShape")] script = ExtResource("4_twx65") _player = NodePath("../AnimationPlayer") _hitbox = NodePath("../Hitbox") @@ -160,4 +152,4 @@ one_shot = true [connection signal="area_entered" from="Detectionbox" to="Behaviour" method="OnAreaEntered"] [connection signal="timeout" from="PrimeTimer" to="Behaviour" method="Prime"] -[connection signal="timeout" from="Behaviour/ExplosionTimer" to="Explosion" method="Explode"] +[connection signal="timeout" from="Behaviour/ExplosionTimer" to="ExplosionBox" method="Explode"]