courier/scenes/enemy.tscn

55 lines
1.8 KiB
Plaintext

[gd_scene load_steps=5 format=3 uid="uid://d2w5qydbu4alc"]
[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_1svwr"]
[ext_resource type="Texture2D" uid="uid://bne2wm00djjjq" path="res://sprites/antred.png" id="2_75flp"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_w4m25"]
radius = 59.0
height = 325.333
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_nfokl"]
radius = 39.0
height = 272.0
[node name="enemy" type="CharacterBody2D" node_paths=PackedStringArray("nav", "patrolpoints")]
script = ExtResource("1_1svwr")
nav = NodePath("NavigationAgent2D")
patrolpoints = [null]
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.06, 0.06)
texture = ExtResource("2_75flp")
[node name="colltion" type="Area2D" parent="."]
scale = Vector2(0.3, 0.3)
[node name="CollisionShape2D" type="CollisionShape2D" parent="colltion"]
position = Vector2(-34, 11)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_w4m25")
[node name="dictection" type="Area2D" parent="."]
position = Vector2(24, 3)
scale = Vector2(0.5, 0.5)
collision_layer = 2
collision_mask = 2
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="dictection"]
polygon = PackedVector2Array(-526, 174, -526, -196, 2883, -934, 2919, 1070)
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
position = Vector2(-10.2, 3.3)
rotation = 1.5708
scale = Vector2(0.3, 0.3)
shape = SubResource("CapsuleShape2D_nfokl")
[node name="Timer" type="Timer" parent="."]
wait_time = 5.0
one_shot = true
[connection signal="body_entered" from="colltion" to="." method="_on_colltion_body_entered"]
[connection signal="body_entered" from="dictection" to="." method="_on_dictection_body_entered"]
[connection signal="body_exited" from="dictection" to="." method="_on_dictection_body_exited"]