40 lines
1.4 KiB
Plaintext
40 lines
1.4 KiB
Plaintext
[gd_scene load_steps=4 format=3 uid="uid://d2w5qydbu4alc"]
|
|
|
|
[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_1svwr"]
|
|
[ext_resource type="Texture2D" uid="uid://cqjv6gj3aanf5" path="res://sprites/antred.png" id="2_75flp"]
|
|
|
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_w4m25"]
|
|
radius = 30.0
|
|
height = 278.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.3, 0.3)
|
|
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(9, 2, 2883, -934, 2919, 1070)
|
|
|
|
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
|
|
|
|
[connection signal="body_entered" from="dictection" to="." method="_on_dictection_body_entered"]
|
|
[connection signal="body_exited" from="dictection" to="." method="_on_dictection_body_exited"]
|