Изменена логика доспеха

This commit is contained in:
Евгений Титаренко 2023-08-19 11:51:46 +03:00
parent 429fe9b62f
commit 1fe08a596d
4 changed files with 133 additions and 43 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=3 uid="uid://bpusphyhhg074"]
[gd_scene load_steps=7 format=3 uid="uid://bpusphyhhg074"]
[ext_resource type="SpriteFrames" uid="uid://cw4pv1qucngxu" path="res://sprites/enemies/armor/living_armor.tres" id="1_j445m"]
[ext_resource type="Script" path="res://scripts/enemies/LivingArmor.cs" id="1_ofbsx"]
@ -7,10 +7,17 @@
[sub_resource type="RectangleShape2D" id="RectangleShape2D_d1ojb"]
size = Vector2(15, 15)
[sub_resource type="CircleShape2D" id="CircleShape2D_ex1co"]
radius = 150.0
[sub_resource type="CircleShape2D" id="CircleShape2D_62y1x"]
radius = 15.0
[node name="LivingArmor" type="CharacterBody2D"]
collision_layer = 5
collision_mask = 5
script = ExtResource("1_ofbsx")
MovingSpeed = 35.0
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = ExtResource("1_j445m")
@ -28,5 +35,21 @@ polygon = PackedVector2Array(-7, -4, -7, 15, 8, 15, 8, -4, 5, -11, -4, -11)
position = Vector2(0.5, 7.5)
shape = SubResource("RectangleShape2D_d1ojb")
[node name="AreaOfSight" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="AreaOfSight"]
shape = SubResource("CircleShape2D_ex1co")
[node name="PlayerCollision" type="Area2D" parent="."]
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerCollision"]
position = Vector2(1, 8)
shape = SubResource("CircleShape2D_62y1x")
[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"]
[connection signal="body_exited" from="AreaOfSight" to="." method="_OnBodyExited"]
[connection signal="body_entered" from="PlayerCollision" to="." method="_OnPlayerCollision"]
[connection signal="body_exited" from="PlayerCollision" to="." method="_OnPlayerCollisionExited"]

View file

@ -32,6 +32,7 @@ position = Vector2(1, 8)
shape = SubResource("RectangleShape2D_svj4b")
[node name="PlayerCollision" type="Area2D" parent="."]
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerCollision"]
position = Vector2(1, 8)