[gd_scene load_steps=19 format=2]

[ext_resource path="res://scripts/game.gd" type="Script" id=1]
[ext_resource path="res://scenes/player.tscn" type="PackedScene" id=2]
[ext_resource path="res://scripts/ui.gd" type="Script" id=3]
[ext_resource path="res://sprites/frame.png" type="Texture" id=4]
[ext_resource path="res://sprites/live_sprite.png" type="Texture" id=5]
[ext_resource path="res://fonts/myfont.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://scripts/spawner.gd" type="Script" id=7]
[ext_resource path="res://audio/music/super_detender.ogg" type="AudioStream" id=8]

[sub_resource type="Animation" id=1]
resource_name = "explossion"
length = 0.2
tracks/0/type = "value"
tracks/0/path = NodePath(".:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 0.180392, 0.180392, 0.180392, 1 ), Color( 0, 0, 0, 1 ) ]
}

[sub_resource type="ParticlesMaterial" id=2]
emission_shape = 2
emission_box_extents = Vector3( 1, 100, 1 )
flag_disable_z = true
spread = 0.0
gravity = Vector3( 0, 0, 0 )
initial_velocity = 160.0
angular_velocity = 1.66306e-033
orbit_velocity = 0.0
orbit_velocity_random = 0.0

[sub_resource type="DynamicFontData" id=3]
font_path = "res://fonts/myfont.ttf"

[sub_resource type="DynamicFont" id=4]
size = 8
extra_spacing_space = 5
font_data = SubResource( 3 )

[sub_resource type="DynamicFont" id=5]
outline_color = Color( 0.294118, 0.294118, 0.294118, 1 )
extra_spacing_char = 1
extra_spacing_space = 10
font_data = ExtResource( 6 )

[sub_resource type="DynamicFont" id=6]
size = 8
outline_color = Color( 0.294118, 0.294118, 0.294118, 1 )
extra_spacing_space = 5
font_data = ExtResource( 6 )

[sub_resource type="Animation" id=7]
resource_name = "New Anim"
length = 1.6
loop = true
step = 0.8
tracks/0/type = "value"
tracks/0/path = NodePath("restart_hint:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.8 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ false, true ]
}

[sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 192, 8 )

[sub_resource type="RectangleShape2D" id=9]
extents = Vector2( 192, 16 )

[sub_resource type="RectangleShape2D" id=10]
extents = Vector2( 424, 22 )

[node name="game" type="Node2D"]
script = ExtResource( 1 )

[node name="bg" type="Polygon2D" parent="."]
editor/display_folded = true
position = Vector2( -16, -16 )
color = Color( 0, 0, 0, 1 )
polygon = PoolVector2Array( 0, 0, 272, 0, 272, 352, 0, 352 )

[node name="anim" type="AnimationPlayer" parent="bg"]
anims/explossion = SubResource( 1 )

[node name="parts" type="Particles2D" parent="."]
position = Vector2( 120, 32 )
rotation = 1.5708
amount = 32
lifetime = 2.0
fract_delta = false
process_material = SubResource( 2 )

[node name="player" parent="." instance=ExtResource( 2 )]
position = Vector2( 112, 256 )

[node name="ui_layer" type="CanvasLayer" parent="."]
pause_mode = 2
script = ExtResource( 3 )

[node name="ui" type="Control" parent="ui_layer"]
margin_right = 240.0
margin_bottom = 240.0

[node name="frame" type="TextureRect" parent="ui_layer/ui"]
margin_right = 240.0
margin_bottom = 320.0
texture = ExtResource( 4 )

[node name="high_score_lbl" type="Label" parent="ui_layer/ui"]
margin_left = 96.0
margin_right = 170.0
margin_bottom = 16.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "high score:"
valign = 1

[node name="high_score" type="Label" parent="ui_layer/ui"]
margin_left = 96.0
margin_top = 16.0
margin_right = 176.0
margin_bottom = 32.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 0, 0, 1 )
text = "00000000"

[node name="enemies_count" type="Label" parent="ui_layer/ui"]
margin_left = 170.0
margin_top = 16.0
margin_right = 224.0
margin_bottom = 32.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "0"
align = 2

[node name="score" type="Label" parent="ui_layer/ui"]
margin_left = 16.0
margin_top = 16.0
margin_right = 96.0
margin_bottom = 32.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 1, 0, 1 )
text = "00000000"

[node name="waves" type="Label" parent="ui_layer/ui"]
margin_left = 16.0
margin_right = 64.0
margin_bottom = 16.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 0, 1, 0, 1 )
custom_constants/line_spacing = 0
text = "Wave: 1"
valign = 1

[node name="hint" type="Label" parent="ui_layer/ui"]
margin_top = 288.0
margin_right = 240.0
margin_bottom = 304.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_constants/line_spacing = 0
text = "press ESC  to pause"
align = 1
valign = 2

[node name="lives" type="Control" parent="ui_layer/ui"]
editor/display_folded = true
margin_left = 176.0
margin_right = 224.0
margin_bottom = 16.0

[node name="live" type="TextureRect" parent="ui_layer/ui/lives"]
margin_right = 16.0
margin_bottom = 16.0
texture = ExtResource( 5 )

[node name="live2" type="TextureRect" parent="ui_layer/ui/lives"]
margin_left = 16.0
margin_right = 32.0
margin_bottom = 16.0
texture = ExtResource( 5 )

[node name="live3" type="TextureRect" parent="ui_layer/ui/lives"]
margin_left = 32.0
margin_right = 48.0
margin_bottom = 16.0
texture = ExtResource( 5 )

[node name="game_over_label" type="Label" parent="ui_layer/ui"]
visible = false
margin_top = 128.0
margin_right = 240.0
margin_bottom = 147.0
custom_fonts/font = SubResource( 5 )
custom_colors/font_color = Color( 1, 0, 0, 1 )
text = "GAME OVER"
align = 1
valign = 1

[node name="final_score" type="Label" parent="ui_layer/ui"]
visible = false
margin_top = 147.0
margin_right = 240.0
margin_bottom = 176.0
custom_fonts/font = SubResource( 6 )
custom_colors/font_color = Color( 1, 1, 0, 1 )
text = "your score:"
align = 1
valign = 1

[node name="restart_hint" type="Label" parent="ui_layer/ui"]
visible = false
margin_top = 176.0
margin_right = 240.0
margin_bottom = 192.0
custom_fonts/font = SubResource( 6 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "press ENTER to restart"
align = 1
valign = 1

[node name="anim" type="AnimationPlayer" parent="ui_layer/ui"]
"anims/New Anim" = SubResource( 7 )

[node name="pause_menu" type="Control" parent="ui_layer/ui"]
visible = false
margin_right = 240.0
margin_bottom = 320.0

[node name="item_1" type="Label" parent="ui_layer/ui/pause_menu"]
margin_top = 100.0
margin_right = 240.0
margin_bottom = 120.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "--- continue ---"
align = 1
valign = 1

[node name="item_2" type="Label" parent="ui_layer/ui/pause_menu"]
margin_top = 120.0
margin_right = 240.0
margin_bottom = 140.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "restart"
align = 1
valign = 1

[node name="item_3" type="Label" parent="ui_layer/ui/pause_menu"]
margin_top = 140.0
margin_right = 240.0
margin_bottom = 160.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "exit"
align = 1
valign = 1

[node name="spawner" type="Node2D" parent="."]
script = ExtResource( 7 )

[node name="home" type="Area2D" parent="."]
editor/display_folded = true
position = Vector2( 120, 312 )
monitoring = false
collision_layer = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="home"]
shape = SubResource( 8 )

[node name="enemy_base" type="Area2D" parent="."]
editor/display_folded = true
position = Vector2( 120, 312 )
monitoring = false
collision_layer = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="enemy_base"]
position = Vector2( 0, -360 )
shape = SubResource( 9 )

[node name="bullet_collector" type="Area2D" parent="."]
position = Vector2( 120, 312 )
monitorable = false
collision_layer = 32
collision_mask = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="bullet_collector"]
position = Vector2( -8, -302 )
shape = SubResource( 10 )

[node name="CollisionShape2D2" type="CollisionShape2D" parent="bullet_collector"]
position = Vector2( -8, -2 )
shape = SubResource( 10 )

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
pause_mode = 2
stream = ExtResource( 8 )
autoplay = true
bus = "music"
[connection signal="area_entered" from="bullet_collector" to="." method="_on_bullet_collector_area_entered"]
