[gd_scene load_steps=34 format=3 uid="uid://c1335fke4thpm"]

[ext_resource type="Script" uid="uid://bndu1h5kgcde8" path="res://scripts/level/RuntimeLevelData.cs" id="1_tnxdx"]
[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/background_summer.png" id="1_vafkg"]
[ext_resource type="Script" uid="uid://bso32xkw738sy" path="res://scripts/level/PoolContainer.cs" id="3_6128b"]
[ext_resource type="PackedScene" uid="uid://devn21c7luf45" path="res://scenes/level components/field_controller.tscn" id="4_ibntj"]
[ext_resource type="PackedScene" uid="uid://cfnmspei3k4p7" path="res://scenes/gui/runtime_gui.tscn" id="5_iotae"]
[ext_resource type="PackedScene" uid="uid://dpxxjfd5lv5sv" path="res://scenes/gui/choose_your_seeds.tscn" id="6_btfw3"]
[ext_resource type="PackedScene" uid="uid://fm471x22n8kr" path="res://scenes/gui/pause_menu.tscn" id="7_3ghv7"]
[ext_resource type="Script" uid="uid://cslqjdd5wq4rc" path="res://scripts/level/SunSpawner.cs" id="7_gnb05"]
[ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="8_8nyym"]
[ext_resource type="Texture2D" uid="uid://bt0slphfqhhab" path="res://assets/sprites/atlases/brain.tres" id="8_h1ksq"]
[ext_resource type="Script" uid="uid://bsuw5lvnr3kol" path="res://scripts/level/zombe_spawners/ZombieSequencer.cs" id="9_8nyym"]
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="9_jmik4"]
[ext_resource type="PackedScene" uid="uid://jm7wm08d2mi7" path="res://scenes/level components/right_boundary_marker.tscn" id="9_q2l3d"]
[ext_resource type="Script" uid="uid://nkb6i7lrkl8y" path="res://scripts/level/zombe_spawners/SurvivalZombieSpawner.cs" id="10_1kjp6"]
[ext_resource type="Script" uid="uid://btqwxelqxheh3" path="res://scripts/gui/RestartButton.cs" id="10_4il7a"]
[ext_resource type="PackedScene" uid="uid://plc2gus4ppds" path="res://scenes/level components/left_boundary_marker.tscn" id="10_5h8lk"]
[ext_resource type="Script" uid="uid://dpdpv2oyxdna7" path="res://scripts/gui/ExitButton.cs" id="11_q1dn6"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="12_4il7a"]
[ext_resource type="Script" uid="uid://blpu7t8tf6277" path="res://scripts/particles/FallFloor.cs" id="13_5h8lk"]
[ext_resource type="AudioStream" uid="uid://bdx83fokp6kha" path="res://assets/audio/sfx/buttonclick.mp3" id="13_q1dn6"]
[ext_resource type="Script" uid="uid://c0ov2bq5er0gh" path="res://scripts/plants/LoseZone.cs" id="16_r81g1"]
[ext_resource type="Script" uid="uid://812ldoyxd5n5" path="res://scripts/level/LoseCheckbox.cs" id="17_pb02i"]
[ext_resource type="AudioStream" uid="uid://bxshjvvtv3fmp" path="res://assets/audio/music/playlist.tres" id="23_tsy2s"]

[sub_resource type="GDScript" id="GDScript_tsy2s"]
resource_name = "time_label"
script/source = "extends Label

var time : float = 0

func _process(delta: float) -> void:
	time += delta
	var itime = int(time)
	text = \"%02d:%02d:%02d\" % [itime / 3600 ,itime / 60 % 60,itime % 60]
"

[sub_resource type="Animation" id="Animation_r81g1"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Fade:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Fade/Brainz:self_modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Fade:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("VBoxContainer:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("VBoxContainer:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}

[sub_resource type="Animation" id="Animation_h1ksq"]
resource_name = "fade"
length = 4.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Fade:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Fade/Brainz:self_modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1.6, 2.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Fade:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.0333333),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("VBoxContainer:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.0333333),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("VBoxContainer:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 2.96667, 4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_pb02i"]
_data = {
&"RESET": SubResource("Animation_r81g1"),
&"fade": SubResource("Animation_h1ksq")
}

[sub_resource type="AtlasTexture" id="AtlasTexture_tsy2s"]
atlas = ExtResource("9_jmik4")
region = Rect2(255, 221, 118, 20)

[sub_resource type="AtlasTexture" id="AtlasTexture_63iib"]
atlas = ExtResource("9_jmik4")
region = Rect2(194, 221, 61, 20)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_pb02i"]
size = Vector2(244, 399)

[sub_resource type="Curve" id="Curve_1kjp6"]
_limits = [0.0, 5.0, 0.0, 2000.0]
_data = [Vector2(0, 0), 0.0, 0.000634783, 0, 0, Vector2(19.8456, 0.0978518), 0.0, 0.0, 0, 0, Vector2(114.664, 0.12832), 0.0, 0.0, 0, 0, Vector2(213.892, 0.465625), 0.0017272, 0.00230293, 0, 0, Vector2(1499.45, 2.99414), 0.0, 0.00350837, 0, 0, Vector2(2000, 5), 0.00737658, 0.0, 0, 0]
point_count = 6

[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_3ghv7"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_r81g1"]
size = Vector2(282, 399)

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

[node name="Data" type="Node" parent="."]
script = ExtResource("1_tnxdx")
SunCount = 50.0

[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(481, 200)

[node name="Pools" type="Node2D" parent="." node_paths=PackedStringArray("Zombies", "Plants", "Projectiles", "Structures", "Particles")]
script = ExtResource("3_6128b")
Zombies = NodePath("Zombies")
Plants = NodePath("Plants")
Projectiles = NodePath("Projectiles")
Structures = NodePath("Structures")
Particles = NodePath("Particles")

[node name="Zombies" type="Node2D" parent="Pools"]
z_index = 3
y_sort_enabled = true

[node name="Plants" type="Node2D" parent="Pools"]
z_index = 1
y_sort_enabled = true

[node name="Projectiles" type="Node2D" parent="Pools"]
z_index = 4
y_sort_enabled = true

[node name="Structures" type="Node2D" parent="Pools"]
z_index = 2
y_sort_enabled = true

[node name="Particles" type="Node2D" parent="Pools"]
z_index = 5

[node name="Background" type="CanvasLayer" parent="."]
layer = -2
follow_viewport_enabled = true

[node name="Background" type="Sprite2D" parent="Background"]
position = Vector2(500, 200)
texture = ExtResource("1_vafkg")
metadata/_edit_lock_ = true

[node name="HUD" type="CanvasLayer" parent="."]
layer = -1

[node name="RuntimeGUI" parent="HUD" instance=ExtResource("5_iotae")]
metadata/_edit_lock_ = true

[node name="Overlay" type="CanvasLayer" parent="."]
layer = 6
follow_viewport_enabled = true

[node name="FieldController" parent="Overlay" instance=ExtResource("4_ibntj")]

[node name="GUI" type="CanvasLayer" parent="."]
layer = 10

[node name="ChooseYourSeeds" parent="GUI" instance=ExtResource("6_btfw3")]
metadata/_edit_lock_ = true

[node name="PauseMenu" parent="GUI" instance=ExtResource("7_3ghv7")]
visible = false

[node name="TimeLabel" type="Label" parent="GUI"]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -40.0
offset_top = -17.0
grow_horizontal = 0
grow_vertical = 0
script = SubResource("GDScript_tsy2s")

[node name="GameOverScreen" type="CanvasLayer" parent="."]
process_mode = 3
layer = 11

[node name="Fade" type="ColorRect" parent="GameOverScreen"]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)

[node name="Brainz" type="TextureRect" parent="GameOverScreen/Fade"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 141.0
offset_top = 146.0
offset_right = -143.0
offset_bottom = -137.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("8_h1ksq")

[node name="AnimationPlayer" type="AnimationPlayer" parent="GameOverScreen"]
libraries = {
&"": SubResource("AnimationLibrary_pb02i")
}

[node name="VBoxContainer" type="VBoxContainer" parent="GameOverScreen"]
visible = false
offset_left = 230.0
offset_top = 273.0
offset_right = 372.0
offset_bottom = 365.0

[node name="RestartButton" type="Button" parent="GameOverScreen/VBoxContainer"]
layout_mode = 2
icon = SubResource("AtlasTexture_tsy2s")
icon_alignment = 1
script = ExtResource("10_4il7a")

[node name="ExitButton" type="Button" parent="GameOverScreen/VBoxContainer"]
layout_mode = 2
icon = SubResource("AtlasTexture_63iib")
icon_alignment = 1
script = ExtResource("11_q1dn6")

[node name="TapPlayer" type="Node" parent="GameOverScreen/VBoxContainer"]
script = ExtResource("12_4il7a")
audioStream = ExtResource("13_q1dn6")
channel = "button"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"

[node name="GameOverZombie" type="CanvasLayer" parent="."]
process_mode = 3
layer = 12
follow_viewport_enabled = true

[node name="LoseZone" type="Node2D" parent="GameOverZombie"]
script = ExtResource("16_r81g1")

[node name="Hitbox" type="Area2D" parent="GameOverZombie/LoseZone"]
collision_layer = 2

[node name="CollisionShape2D" type="CollisionShape2D" parent="GameOverZombie/LoseZone/Hitbox"]
position = Vector2(122, 199.5)
shape = SubResource("RectangleShape2D_pb02i")

[node name="SunSpawner" type="Node" parent="."]
script = ExtResource("7_gnb05")
SunScene = ExtResource("8_8nyym")

[node name="Timer" type="Timer" parent="SunSpawner"]
wait_time = 10.0
autostart = true

[node name="right_boundary_marker" parent="." instance=ExtResource("9_q2l3d")]
position = Vector2(755, 376)

[node name="LeftBoundaryMarker" parent="." instance=ExtResource("10_5h8lk")]
position = Vector2(305, 76)

[node name="ZombieSequencer" type="Node2D" parent="." node_paths=PackedStringArray("spawnTimer", "waveTimer")]
position = Vector2(823, 0)
script = ExtResource("9_8nyym")
spawnTimer = NodePath("Timer")
waveTimer = NodePath("../SurvivalAI/Timer")

[node name="Timer" type="Timer" parent="ZombieSequencer"]
wait_time = 2.5
autostart = true

[node name="SurvivalAI" type="Node" parent="."]
script = ExtResource("10_1kjp6")
supportPool = Array[String](["hobo", "door_zombie"])
tankPool = Array[String](["conehead", "buckethead", "hobo", "door_zombie"])
hordePool = Array[String](["basic", "conehead", "buckethead"])
velocity_curve = SubResource("Curve_1kjp6")

[node name="Timer" type="Timer" parent="SurvivalAI"]
wait_time = 10.0

[node name="Timer" type="Timer" parent="SurvivalAI/Timer"]
wait_time = 20.0
one_shot = true
autostart = true

[node name="Lines" type="Node2D" parent="."]
script = ExtResource("13_5h8lk")

[node name="Floor" type="StaticBody2D" parent="Lines"]
position = Vector2(528, 247)
collision_layer = 64
collision_mask = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="Lines/Floor"]
shape = SubResource("WorldBoundaryShape2D_3ghv7")

[node name="Floor2" type="StaticBody2D" parent="Lines"]
position = Vector2(528, 306)
collision_layer = 64
collision_mask = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="Lines/Floor2"]
shape = SubResource("WorldBoundaryShape2D_3ghv7")

[node name="Floor3" type="StaticBody2D" parent="Lines"]
position = Vector2(528, 367)
collision_layer = 64
collision_mask = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="Lines/Floor3"]
shape = SubResource("WorldBoundaryShape2D_3ghv7")

[node name="Floor4" type="StaticBody2D" parent="Lines"]
position = Vector2(528, 183)
collision_layer = 64
collision_mask = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="Lines/Floor4"]
shape = SubResource("WorldBoundaryShape2D_3ghv7")

[node name="Floor5" type="StaticBody2D" parent="Lines"]
position = Vector2(528, 132)
collision_layer = 64
collision_mask = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="Lines/Floor5"]
shape = SubResource("WorldBoundaryShape2D_3ghv7")

[node name="Checkbox" type="Area2D" parent="." node_paths=PackedStringArray("gameOverLayer", "fadeAnimation")]
collision_mask = 24
script = ExtResource("17_pb02i")
gameOverLayer = NodePath("../GameOverZombie")
fadeAnimation = NodePath("../GameOverScreen/AnimationPlayer")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Checkbox"]
position = Vector2(141, 199.5)
shape = SubResource("RectangleShape2D_r81g1")

[node name="MusicPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("23_tsy2s")
autoplay = true
bus = &"MusicBus"

[connection signal="pressed" from="GameOverScreen/VBoxContainer/RestartButton" to="GameOverScreen/VBoxContainer/TapPlayer" method="Play"]
[connection signal="pressed" from="GameOverScreen/VBoxContainer/ExitButton" to="GameOverScreen/VBoxContainer/TapPlayer" method="Play"]
[connection signal="timeout" from="SunSpawner/Timer" to="SunSpawner" method="Spawn"]
[connection signal="timeout" from="ZombieSequencer/Timer" to="ZombieSequencer" method="FormSquad"]
[connection signal="timeout" from="SurvivalAI/Timer" to="SurvivalAI" method="SummonWave"]
[connection signal="timeout" from="SurvivalAI/Timer/Timer" to="SurvivalAI" method="SummonWave"]
[connection signal="timeout" from="SurvivalAI/Timer/Timer" to="SurvivalAI/Timer" method="start"]
