[gd_scene load_steps=9 format=1]

[ext_resource path="res://enemy1.gd" type="Script" id=1]
[ext_resource path="res://enemy1.png" type="Texture" id=2]
[ext_resource path="res://explosion.tscn" type="PackedScene" id=3]
[ext_resource path="res://sound_explode.wav" type="Sample" id=4]

[sub_resource type="ConvexPolygonShape2D" id=1]

custom_solver_bias = 0.0
points = Vector2Array( -25.3272, 15.4072, -31.2711, -7.28794, -1.01097, -20.7969, 24.9263, -4.58614, 30.3299, 13.2457, -2.63205, 17.5686 )

[sub_resource type="Animation" id=2]

length = 1.0
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:visibility/visible")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ false ] }
tracks/1/type = "value"
tracks/1/path = NodePath("explosion:config/emitting")
tracks/1/interp = 1
tracks/1/keys = { "cont":false, "times":FloatArray( 0, 0.1 ), "transitions":FloatArray( 1, 1 ), "values":[ true, false ] }
tracks/2/type = "method"
tracks/2/path = NodePath("..")
tracks/2/interp = 1
tracks/2/keys = { "times":FloatArray( 0.9 ), "transitions":FloatArray( 1 ), "values":[ { "args":[  ], "method":"queue_free" } ] }

[sub_resource type="Animation" id=3]

length = 2.0
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath(".:transform/pos")
tracks/0/interp = 1
tracks/0/keys = { "cont":true, "times":FloatArray( 0, 1 ), "transitions":FloatArray( -1.86607, -1.86607 ), "values":[ Vector2( 0, -100 ), Vector2( 0, 100 ) ] }

[sub_resource type="SampleLibrary" id=4]

samples/sound_explode = { "db":0.0, "pitch":1.0, "sample":ExtResource( 4 ) }

[node name="enemy1" type="Node2D"]

[node name="area" type="Area2D" parent="."]

transform/pos = Vector2( 0, -100 )
input/pickable = true
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
script/script = ExtResource( 1 )

[node name="collision" type="CollisionPolygon2D" parent="area"]

build_mode = 0
polygon = Vector2Array( -31.2711, -7.28794, -1.01097, -20.7969, 24.9263, -4.58614, 30.3299, 13.2457, -2.63205, 17.5686, -25.3272, 15.4072 )
shape_range = Vector2( -1, -1 )
trigger = false

[node name="sprite" type="Sprite" parent="area"]

texture = ExtResource( 2 )

[node name="explosion" parent="area" instance=ExtResource( 3 )]

transform/rot = -91.1436
config/explosiveness = 0.1
params/gravity_strength = 9.8

[node name="anim" type="AnimationPlayer" parent="area"]

playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/explode = SubResource( 2 )
anims/zigzag = SubResource( 3 )
playback/active = true
playback/speed = 1.0
blend_times = [  ]
autoplay = ""

[node name="visibility" type="VisibilityNotifier2D" parent="area"]

rect = Rect2( -10, -10, 20, 20 )

[node name="sfx" type="SamplePlayer2D" parent="area"]

params/volume_db = 0.0
params/pitch_scale = 1.0
params/attenuation/min_distance = 1.0
params/attenuation/max_distance = 2048.0
params/attenuation/distance_exp = 1.0
config/polyphony = 1
config/samples = SubResource( 4 )
config/pitch_random = 0.0

[connection signal="enter_screen" from="area/visibility" to="area" method="_on_visibility_enter_screen"]

[connection signal="exit_screen" from="area/visibility" to="area" method="_on_visibility_exit_screen"]