[gd_scene load_steps=11 format=3 uid="uid://bodpgjdjhfn4w"]

[ext_resource type="PackedScene" uid="uid://csacin2gx2tum" path="res://scenes/spaceShip/spaceShip.tscn" id="1_5w6ng"]
[ext_resource type="Script" uid="uid://djlqf2g8ho05r" path="res://scenes/spaceShip/enemy/enemy.gd" id="2_2erf0"]
[ext_resource type="Texture2D" uid="uid://dansb0wnm00vb" path="res://assets/enemy/shotgunEnemy.png" id="3_7vnn2"]
[ext_resource type="Texture2D" uid="uid://bkc8av1vbis4r" path="res://assets/enemy/enemy.png" id="3_hybmu"]
[ext_resource type="PackedScene" uid="uid://k5fr6bfn6kkd" path="res://scenes/spaceShip/enemy/visionArea/visionArea.tscn" id="4_hybmu"]
[ext_resource type="Texture2D" uid="uid://mftd7366eymt" path="res://assets/enemy/minigunEnemy.png" id="4_ibucj"]
[ext_resource type="Texture2D" uid="uid://iddqk6g00rku" path="res://assets/enemy/RailgunEnemy.png" id="5_fmf0p"]
[ext_resource type="AudioStream" uid="uid://vjxm7ay4t2ju" path="res://assets/sound/hit2.wav" id="5_gid86"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_2erf0"]
size = Vector2(112, 112)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_u13ds"]
size = Vector2(112, 112)

[node name="Enemy" groups=["enemy"] instance=ExtResource("1_5w6ng")]
collision_layer = 36
collision_mask = 67
script = ExtResource("2_2erf0")
range = 800
shotgunTexture = ExtResource("3_7vnn2")
minigunTexture = ExtResource("4_ibucj")
railgunTexture = ExtResource("5_fmf0p")
maxHealth = 10
speed = 1000

[node name="CollisionShape2D" parent="." index="0"]
shape = SubResource("RectangleShape2D_2erf0")

[node name="CollisionShape2D" parent="hurtArea" index="0"]
shape = SubResource("RectangleShape2D_u13ds")

[node name="Sprite2D" parent="." index="2"]
position = Vector2(0, -24)
texture = ExtResource("3_hybmu")

[node name="VisionAreas" type="Node2D" parent="." index="5"]

[node name="VisionArea" parent="VisionAreas" index="0" instance=ExtResource("4_hybmu")]

[node name="VisionAreaStop" parent="VisionAreas" index="1" instance=ExtResource("4_hybmu")]

[node name="VisionAreaEnemy" parent="VisionAreas" index="2" instance=ExtResource("4_hybmu")]
collision_mask = 32

[node name="RayCast2D" type="RayCast2D" parent="." index="6"]
target_position = Vector2(0, -448)
collision_mask = 32
hit_from_inside = true

[node name="hit" type="AudioStreamPlayer2D" parent="." index="7"]
stream = ExtResource("5_gid86")

[connection signal="hurt" from="hurtArea" to="." method="_on_hurt_area_hurt"]

[editable path="hurtArea"]
[editable path="VisionAreas/VisionArea"]
[editable path="VisionAreas/VisionAreaStop"]
[editable path="VisionAreas/VisionAreaEnemy"]
