Улучшен поиск путей

This commit is contained in:
Евгений Титаренко 2023-08-21 21:27:22 +03:00
parent 3e60215e11
commit 26cc09241f
8 changed files with 107 additions and 18 deletions

View file

@ -4,7 +4,7 @@
[ext_resource type="Script" path="res://scripts/enemies/LivingArmor.cs" id="1_ofbsx"]
[ext_resource type="PackedScene" uid="uid://cf0wpahgwygxx" path="res://prefabs/light_sense.tscn" id="2_xkyos"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_d1ojb"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8sbby"]
size = Vector2(15, 15)
[sub_resource type="CircleShape2D" id="CircleShape2D_ex1co"]
@ -33,7 +33,7 @@ polygon = PackedVector2Array(-7, -4, -7, 15, 8, 15, 8, -4, 5, -11, -4, -11)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0.5, 7.5)
shape = SubResource("RectangleShape2D_d1ojb")
shape = SubResource("RectangleShape2D_8sbby")
[node name="AreaOfSight" type="Area2D" parent="."]
@ -47,6 +47,11 @@ monitorable = false
position = Vector2(1, 8)
shape = SubResource("CircleShape2D_62y1x")
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
path_desired_distance = 0.1
target_desired_distance = 0.1
avoidance_enabled = true
[connection signal="area_entered" from="LightSense" to="." method="_OnLightEntered"]
[connection signal="area_exited" from="LightSense" to="." method="_OnLightExited"]
[connection signal="body_entered" from="AreaOfSight" to="." method="_OnBodyEntered"]