cirnogodot/Scenes/Enemy.tscn
2025-01-31 17:43:17 +01:00

82 lines
2.9 KiB
Text

[gd_scene load_steps=10 format=3 uid="uid://v8s3kubgb2qg"]
[ext_resource type="Texture2D" uid="uid://b4ynnb14mb4uq" path="res://Sprites/Reisen.png" id="1_4w8mj"]
[ext_resource type="Script" path="res://Scripts/Enemy.cs" id="1_lpwdj"]
[ext_resource type="PackedScene" uid="uid://cuixq5ex0j40h" path="res://Scenes/enemyBullet.tscn" id="2_ogldd"]
[ext_resource type="PackedScene" uid="uid://crry0rgk7a8sm" path="res://Scenes/Weapons/BaseWeapon.tscn" id="4_2k1dv"]
[sub_resource type="AtlasTexture" id="AtlasTexture_2brqc"]
atlas = ExtResource("1_4w8mj")
region = Rect2(0, 0, 8, 16)
[sub_resource type="CircleShape2D" id="CircleShape2D_8gtts"]
radius = 7.0
[sub_resource type="CircleShape2D" id="CircleShape2D_cacb5"]
radius = 4.0
[sub_resource type="CircleShape2D" id="CircleShape2D_v711r"]
radius = 85.0529
[sub_resource type="RectangleShape2D" id="RectangleShape2D_m1rsg"]
size = Vector2(8, 12)
[node name="Enemy" type="CharacterBody2D" node_paths=PackedStringArray("EquippedWeapon") groups=["Destroyable"]]
collision_layer = 16
collision_mask = 9
script = ExtResource("1_lpwdj")
EquippedWeapon = NodePath("Weapon")
NavigationEnabled = true
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = SubResource("AtlasTexture_2brqc")
[node name="Damage_HitBox" type="CollisionShape2D" parent="."]
visible = false
shape = SubResource("CircleShape2D_8gtts")
[node name="RigidBody2D" type="RigidBody2D" parent="."]
collision_layer = 16
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
visible = false
position = Vector2(0, 5)
shape = SubResource("CircleShape2D_cacb5")
[node name="PlayerDetection" type="Area2D" parent="."]
visible = false
collision_layer = 16
collision_mask = 2
[node name="PlayerDetectionArea" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("CircleShape2D_v711r")
[node name="ShootTimer" type="Timer" parent="."]
wait_time = 0.4
one_shot = true
[node name="Weapon" parent="." instance=ExtResource("4_2k1dv")]
BulletScene = ExtResource("2_ogldd")
BulletCapacity = 4
BulletSpeed = 50.0
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
target_desired_distance = 64.0
path_max_distance = 800.0
path_postprocessing = 1
avoidance_enabled = true
debug_enabled = true
debug_path_custom_color = Color(1, 0, 0, 1)
[node name="DamageHitbox" type="Area2D" parent="."]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageHitbox"]
shape = SubResource("RectangleShape2D_m1rsg")
[connection signal="area_entered" from="PlayerDetection" to="." method="_on_player_detection_area_entered"]
[connection signal="area_exited" from="PlayerDetection" to="." method="_on_player_detection_area_exited"]
[connection signal="velocity_computed" from="NavigationAgent2D" to="." method="_on_navigation_agent_2d_velocity_computed"]
[connection signal="area_entered" from="DamageHitbox" to="." method="_on_damage_hitbox_area_entered"]