diff --git a/assets/sprites/atlases/atlas2.png b/assets/sprites/atlases/atlas2.png index 4f2a2ad..2e0fca8 100644 Binary files a/assets/sprites/atlases/atlas2.png and b/assets/sprites/atlases/atlas2.png differ diff --git a/assets/sprites/particles/dirt1.tres b/assets/sprites/particles/dirt1.tres new file mode 100644 index 0000000..48c9232 --- /dev/null +++ b/assets/sprites/particles/dirt1.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://d3673b2idj18b"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_5xkyq"] + +[resource] +atlas = ExtResource("1_5xkyq") +region = Rect2(0, 118, 5, 4) diff --git a/assets/sprites/particles/dirt2.tres b/assets/sprites/particles/dirt2.tres new file mode 100644 index 0000000..16f0d98 --- /dev/null +++ b/assets/sprites/particles/dirt2.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bs8cll4gtgwr1"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_kod62"] + +[resource] +atlas = ExtResource("1_kod62") +region = Rect2(0, 114, 8, 4) diff --git a/assets/sprites/particles/dirt3.tres b/assets/sprites/particles/dirt3.tres new file mode 100644 index 0000000..614a89c --- /dev/null +++ b/assets/sprites/particles/dirt3.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://0tja7r7yp1ht"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_go6uf"] + +[resource] +atlas = ExtResource("1_go6uf") +region = Rect2(5, 119, 3, 3) diff --git a/assets/sprites/particles/dirt4.tres b/assets/sprites/particles/dirt4.tres new file mode 100644 index 0000000..fac5862 --- /dev/null +++ b/assets/sprites/particles/dirt4.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://conyd86prykef"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_xragy"] + +[resource] +atlas = ExtResource("1_xragy") +region = Rect2(0, 122, 6, 6) diff --git a/assets/sprites/particles/dirt5.tres b/assets/sprites/particles/dirt5.tres new file mode 100644 index 0000000..2a5a88e --- /dev/null +++ b/assets/sprites/particles/dirt5.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://u6vxm6gejoss"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_sie30"] + +[resource] +atlas = ExtResource("1_sie30") +region = Rect2(6, 124, 5, 4) diff --git a/assets/sprites/particles/dirt6.tres b/assets/sprites/particles/dirt6.tres new file mode 100644 index 0000000..29c3a83 --- /dev/null +++ b/assets/sprites/particles/dirt6.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://biooadlxqqeos"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_gkpel"] + +[resource] +atlas = ExtResource("1_gkpel") +region = Rect2(11, 124, 4, 4) diff --git a/assets/sprites/particles/dirt_material.tres b/assets/sprites/particles/dirt_material.tres new file mode 100644 index 0000000..07457c9 --- /dev/null +++ b/assets/sprites/particles/dirt_material.tres @@ -0,0 +1,29 @@ +[gd_resource type="ParticleProcessMaterial" load_steps=5 format=3 uid="uid://dmpscw60bfrj"] + +[sub_resource type="Curve" id="Curve_oyxjr"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.745794, 1), 0.0, -3.06933, 0, 0, Vector2(1, 0), -4.13429, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_27of4"] +curve = SubResource("Curve_oyxjr") + +[sub_resource type="Curve" id="Curve_lslkg"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.252336, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_p1hhd"] +curve = SubResource("Curve_lslkg") + +[resource] +particle_flag_disable_z = true +emission_shape = 3 +emission_box_extents = Vector3(12.5, 1, 1) +direction = Vector3(0, -1, 0) +spread = 22.5 +initial_velocity_min = 100.0 +initial_velocity_max = 200.0 +angular_velocity_min = -45.0 +angular_velocity_max = 45.0 +gravity = Vector3(0, 294, 0) +scale_curve = SubResource("CurveTexture_p1hhd") +alpha_curve = SubResource("CurveTexture_27of4") diff --git a/assets/sprites/particles/nachinka1.tres b/assets/sprites/particles/nachinka1.tres new file mode 100644 index 0000000..e202f6c --- /dev/null +++ b/assets/sprites/particles/nachinka1.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cad45iyh16x5g"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_hp6my"] + +[resource] +atlas = ExtResource("1_hp6my") +region = Rect2(33, 102, 26, 20) diff --git a/assets/sprites/particles/nachinka2.tres b/assets/sprites/particles/nachinka2.tres new file mode 100644 index 0000000..4b0a744 --- /dev/null +++ b/assets/sprites/particles/nachinka2.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://b3yfl2had6t3o"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_2hid5"] + +[resource] +atlas = ExtResource("1_2hid5") +region = Rect2(59, 102, 20, 21) diff --git a/assets/sprites/particles/nachinka3.tres b/assets/sprites/particles/nachinka3.tres new file mode 100644 index 0000000..9bf8de8 --- /dev/null +++ b/assets/sprites/particles/nachinka3.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://e5v4vpux4h8k"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_7kt0u"] + +[resource] +atlas = ExtResource("1_7kt0u") +region = Rect2(33, 124, 26, 19) diff --git a/assets/sprites/particles/nachinka4.tres b/assets/sprites/particles/nachinka4.tres new file mode 100644 index 0000000..ced723b --- /dev/null +++ b/assets/sprites/particles/nachinka4.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dny6mfpspd3o8"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_h8yw0"] + +[resource] +atlas = ExtResource("1_h8yw0") +region = Rect2(59, 123, 20, 19) diff --git a/assets/sprites/particles/pea_fragment1.tres b/assets/sprites/particles/pea_fragment1.tres new file mode 100644 index 0000000..8e8a67d --- /dev/null +++ b/assets/sprites/particles/pea_fragment1.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://d1ovwgd03fxx5"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_abv80"] + +[resource] +atlas = ExtResource("1_abv80") +region = Rect2(16, 112, 5, 8) diff --git a/assets/sprites/particles/pea_fragment2.tres b/assets/sprites/particles/pea_fragment2.tres new file mode 100644 index 0000000..da824f4 --- /dev/null +++ b/assets/sprites/particles/pea_fragment2.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bmig582h4s38v"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_xysnq"] + +[resource] +atlas = ExtResource("1_xysnq") +region = Rect2(16, 112, 5, 8) diff --git a/assets/sprites/particles/pea_fragment3.tres b/assets/sprites/particles/pea_fragment3.tres new file mode 100644 index 0000000..5453687 --- /dev/null +++ b/assets/sprites/particles/pea_fragment3.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cg3nx7qj8kbkw"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_8fbdt"] + +[resource] +atlas = ExtResource("1_8fbdt") +region = Rect2(25, 112, 4, 8) diff --git a/assets/sprites/particles/pea_material.tres b/assets/sprites/particles/pea_material.tres new file mode 100644 index 0000000..47dfe6f --- /dev/null +++ b/assets/sprites/particles/pea_material.tres @@ -0,0 +1,28 @@ +[gd_resource type="ParticleProcessMaterial" load_steps=5 format=3 uid="uid://0sf0uy1dkxb6"] + +[sub_resource type="Gradient" id="Gradient_6jlap"] +offsets = PackedFloat32Array(0, 0.896552, 1) +colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_uaspe"] +gradient = SubResource("Gradient_6jlap") + +[sub_resource type="Curve" id="Curve_6jlap"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.574074, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_uaspe"] +curve = SubResource("Curve_6jlap") + +[resource] +particle_flag_align_y = true +particle_flag_disable_z = true +direction = Vector3(-1, -1, 0) +spread = 30.0 +initial_velocity_min = 50.0 +initial_velocity_max = 75.0 +gravity = Vector3(0, 98, 0) +scale_min = 0.9 +scale_max = 1.1 +scale_curve = SubResource("CurveTexture_uaspe") +color_ramp = SubResource("GradientTexture1D_uaspe") diff --git a/assets/sprites/particles/potato_material.tres b/assets/sprites/particles/potato_material.tres new file mode 100644 index 0000000..8e50725 --- /dev/null +++ b/assets/sprites/particles/potato_material.tres @@ -0,0 +1,31 @@ +[gd_resource type="ParticleProcessMaterial" load_steps=5 format=3 uid="uid://dvjxab8lnj6ap"] + +[sub_resource type="Curve" id="Curve_lhfmj"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.753378, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_w108h"] +curve = SubResource("Curve_lhfmj") + +[sub_resource type="Curve" id="Curve_1jra6"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.25, 1), 0.0, 0.0, 0, 0, Vector2(0.99999, 0), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_o728e"] +curve = SubResource("Curve_1jra6") + +[resource] +particle_flag_disable_z = true +emission_shape = 3 +emission_box_extents = Vector3(12.5, 1, 1) +angle_min = -203.8 +angle_max = 203.8 +direction = Vector3(0, -1, 0) +initial_velocity_min = 150.0 +initial_velocity_max = 300.0 +angular_velocity_min = -180.0 +angular_velocity_max = 180.0 +gravity = Vector3(0, 294, 0) +scale_max = 1.3 +scale_curve = SubResource("CurveTexture_o728e") +alpha_curve = SubResource("CurveTexture_w108h") diff --git a/assets/sprites/particles/snowflake.tres b/assets/sprites/particles/snowflake.tres new file mode 100644 index 0000000..42c7381 --- /dev/null +++ b/assets/sprites/particles/snowflake.tres @@ -0,0 +1,29 @@ +[gd_resource type="ParticleProcessMaterial" load_steps=5 format=3 uid="uid://bflocbxbpv73j"] + +[sub_resource type="Gradient" id="Gradient_hk082"] +offsets = PackedFloat32Array(0, 0.625, 1) +colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_y37p6"] +gradient = SubResource("Gradient_hk082") + +[sub_resource type="Curve" id="Curve_hw4kb"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_i1rnm"] +curve = SubResource("Curve_hw4kb") + +[resource] +particle_flag_disable_z = true +direction = Vector3(-1, 1, 0) +spread = 0.0 +initial_velocity_min = 100.0 +initial_velocity_max = 100.0 +orbit_velocity_min = -2.0 +orbit_velocity_max = 9.49949e-08 +gravity = Vector3(0, 0, 0) +scale_min = 1.5 +scale_max = 2.0 +scale_curve = SubResource("CurveTexture_i1rnm") +color_ramp = SubResource("GradientTexture1D_y37p6") diff --git a/assets/sprites/particles/snowpea_flake1.tres b/assets/sprites/particles/snowpea_flake1.tres new file mode 100644 index 0000000..5ace40c --- /dev/null +++ b/assets/sprites/particles/snowpea_flake1.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dejgsyw4f2crg"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_8f8yh"] + +[resource] +atlas = ExtResource("1_8f8yh") +region = Rect2(11, 112, 5, 5) diff --git a/assets/sprites/particles/snowpea_flake2.tres b/assets/sprites/particles/snowpea_flake2.tres new file mode 100644 index 0000000..451b392 --- /dev/null +++ b/assets/sprites/particles/snowpea_flake2.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://deiu2jr26meq"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_3ueb8"] + +[resource] +atlas = ExtResource("1_3ueb8") +region = Rect2(11, 118, 5, 5) diff --git a/assets/sprites/particles/snowpea_fragment1.tres b/assets/sprites/particles/snowpea_fragment1.tres new file mode 100644 index 0000000..b9d60b6 --- /dev/null +++ b/assets/sprites/particles/snowpea_fragment1.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://el3weu727cmo"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_r43r3"] + +[resource] +atlas = ExtResource("1_r43r3") +region = Rect2(16, 120, 5, 8) diff --git a/assets/sprites/particles/snowpea_fragment2.tres b/assets/sprites/particles/snowpea_fragment2.tres new file mode 100644 index 0000000..7c93d03 --- /dev/null +++ b/assets/sprites/particles/snowpea_fragment2.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://rv2ibl8ls1kh"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_kmkno"] + +[resource] +atlas = ExtResource("1_kmkno") +region = Rect2(21, 123, 4, 5) diff --git a/assets/sprites/particles/snowpea_fragment3.tres b/assets/sprites/particles/snowpea_fragment3.tres new file mode 100644 index 0000000..d406fca --- /dev/null +++ b/assets/sprites/particles/snowpea_fragment3.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bgg1n8802ebm6"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_ht11m"] + +[resource] +atlas = ExtResource("1_ht11m") +region = Rect2(25, 120, 4, 8) diff --git a/project.godot b/project.godot index b6691c5..51269cc 100644 --- a/project.godot +++ b/project.godot @@ -44,7 +44,8 @@ folder_colors={ "res://assets/sprites/atlases/plants/": "green", "res://resources/plants/": "green", "res://scenes/": "red", -"res://scenes/entities/plants/": "green" +"res://scenes/entities/plants/": "green", +"res://scripts/": "blue" } [gui] diff --git a/scenes/entities/plants/potato_mine.tscn b/scenes/entities/plants/potato_mine.tscn index 03128c9..5918170 100644 --- a/scenes/entities/plants/potato_mine.tscn +++ b/scenes/entities/plants/potato_mine.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=20 format=3 uid="uid://b5x35v3w2u8dx"] +[gd_scene load_steps=21 format=3 uid="uid://b5x35v3w2u8dx"] [ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_dj7ul"] [ext_resource type="Texture2D" uid="uid://c77o6ba0mw7a3" path="res://assets/sprites/atlases/plants/potato_mine.png" id="2_sneas"] [ext_resource type="Script" uid="uid://bhl6o2m3fn4xg" path="res://scripts/components/plants/ExplosionComponent.cs" id="3_2hd5y"] [ext_resource type="AnimationLibrary" uid="uid://bjlbdvr6f0r7e" path="res://resources/animations/plants/potato_mine.res" id="3_7tqmj"] [ext_resource type="Script" uid="uid://c7qfh4py0uulo" path="res://scripts/components/plants/behaviours/PotatomineBehaviour.cs" id="4_twx65"] +[ext_resource type="PackedScene" uid="uid://ckanq33rao1ur" path="res://scenes/particles/potato_explosion.tscn" id="5_px4r0"] [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6uutc"] animation = &"potato_mine/explode" @@ -96,6 +97,7 @@ collision_layer = 0 collision_mask = 8 script = ExtResource("3_2hd5y") damage = 6000 +particles = ExtResource("5_px4r0") [node name="CollisionShape2D" type="CollisionShape2D" parent="ExplosionBox" index="0"] position = Vector2(0, 9) diff --git a/scenes/gui/pause.tscn b/scenes/gui/pause.tscn deleted file mode 100644 index eeda480..0000000 --- a/scenes/gui/pause.tscn +++ /dev/null @@ -1,163 +0,0 @@ -[gd_scene load_steps=13 format=3 uid="uid://c1ctn2bvt4cpq"] - -[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_4k24j"] -[ext_resource type="Script" uid="uid://gvwhpjoame6m" path="res://scripts/components/gui/PauseMenu.cs" id="2_tifvb"] -[ext_resource type="AudioStream" uid="uid://co33ajpc1a1qm" path="res://assets/audio/zo.mp3" id="3_or0he"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_tifvb"] -atlas = ExtResource("1_4k24j") -region = Rect2(0, 0, 177, 174) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jd4l2"] -atlas = ExtResource("1_4k24j") -region = Rect2(177, 0, 42, 40) - -[sub_resource type="LabelSettings" id="LabelSettings_or0he"] -font_size = 32 -outline_size = 2 - -[sub_resource type="AtlasTexture" id="AtlasTexture_4k24j"] -atlas = ExtResource("1_4k24j") -region = Rect2(0, 221, 127, 20) - -[sub_resource type="AtlasTexture" id="AtlasTexture_or0he"] -atlas = ExtResource("1_4k24j") -region = Rect2(255, 221, 118, 20) - -[sub_resource type="AtlasTexture" id="AtlasTexture_y3stn"] -atlas = ExtResource("1_4k24j") -region = Rect2(194, 221, 61, 20) - -[sub_resource type="Animation" id="Animation_2swbg"] -resource_name = "main" -length = 10.0 -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Flower:position") -tracks/0/interp = 2 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 5, 10), -"transitions": PackedFloat32Array(-2, -2, -2), -"update": 0, -"values": [Vector2(110, 7), Vector2(110, 7), Vector2(110, 7)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Flower:rotation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 5, 10), -"transitions": PackedFloat32Array(-2, -2, -2), -"update": 0, -"values": [-0.352319, 0.330185, -0.352319] -} - -[sub_resource type="Animation" id="Animation_miax1"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Flower:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector2(110, 7)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Flower:rotation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [-0.352319] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_ksc54"] -_data = { -&"RESET": SubResource("Animation_miax1"), -&"main": SubResource("Animation_2swbg") -} - -[node name="Pause" type="NinePatchRect"] -process_mode = 3 -anchors_preset = -1 -anchor_left = 0.318333 -anchor_top = 0.185 -anchor_right = 0.755 -anchor_bottom = 0.8325 -texture = SubResource("AtlasTexture_tifvb") -patch_margin_left = 73 -patch_margin_top = 98 -patch_margin_right = 73 -patch_margin_bottom = 52 -script = ExtResource("2_tifvb") -metadata/_edit_use_anchors_ = true - -[node name="Flower" type="TextureRect" parent="."] -z_index = -1 -layout_mode = 1 -anchors_preset = -1 -anchor_left = 0.419848 -anchor_top = 0.027027 -anchor_right = 0.580153 -anchor_bottom = 0.181467 -rotation = -0.352319 -pivot_offset = Vector2(21, 39) -texture = SubResource("AtlasTexture_jd4l2") -metadata/_edit_use_anchors_ = true - -[node name="HBoxContainer" type="HBoxContainer" parent="."] -layout_mode = 0 -offset_left = 58.0002 -offset_top = 69.0 -offset_right = 209.0 -offset_bottom = 246.0 - -[node name="Buttons" type="VBoxContainer" parent="HBoxContainer"] -layout_mode = 2 - -[node name="PAUSED" type="Label" parent="HBoxContainer/Buttons"] -layout_mode = 2 -text = "PAUSED" -label_settings = SubResource("LabelSettings_or0he") -horizontal_alignment = 1 -metadata/_edit_use_anchors_ = true - -[node name="ContinueButton" type="Button" parent="HBoxContainer/Buttons"] -layout_mode = 2 -icon = SubResource("AtlasTexture_4k24j") - -[node name="RestartButton" type="Button" parent="HBoxContainer/Buttons"] -layout_mode = 2 -icon = SubResource("AtlasTexture_or0he") -icon_alignment = 1 - -[node name="ExitButton" type="Button" parent="HBoxContainer/Buttons"] -layout_mode = 2 -icon = SubResource("AtlasTexture_y3stn") -icon_alignment = 1 - -[node name="Audio" type="AudioStreamPlayer" parent="."] -stream = ExtResource("3_or0he") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -&"": SubResource("AnimationLibrary_ksc54") -} -autoplay = "main" - -[connection signal="pressed" from="HBoxContainer/Buttons/ContinueButton" to="." method="Continue"] -[connection signal="pressed" from="HBoxContainer/Buttons/RestartButton" to="." method="Restart"] -[connection signal="pressed" from="HBoxContainer/Buttons/ExitButton" to="." method="Exit"] diff --git a/scenes/gui/pause_menu.tscn b/scenes/gui/pause_menu.tscn new file mode 100644 index 0000000..f275a83 --- /dev/null +++ b/scenes/gui/pause_menu.tscn @@ -0,0 +1,93 @@ +[gd_scene load_steps=9 format=3 uid="uid://fm471x22n8kr"] + +[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_loim0"] +[ext_resource type="Script" uid="uid://gvwhpjoame6m" path="res://scripts/components/gui/PauseMenu.cs" id="2_4vp8g"] +[ext_resource type="AudioStream" uid="uid://co33ajpc1a1qm" path="res://assets/audio/zo.mp3" id="3_e3p60"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_tifvb"] +atlas = ExtResource("1_loim0") +region = Rect2(0, 0, 177, 174) + +[sub_resource type="LabelSettings" id="LabelSettings_or0he"] +font_size = 32 +outline_size = 2 + +[sub_resource type="AtlasTexture" id="AtlasTexture_4k24j"] +atlas = ExtResource("1_loim0") +region = Rect2(0, 221, 127, 20) + +[sub_resource type="AtlasTexture" id="AtlasTexture_or0he"] +atlas = ExtResource("1_loim0") +region = Rect2(255, 221, 118, 20) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y3stn"] +atlas = ExtResource("1_loim0") +region = Rect2(194, 221, 61, 20) + +[node name="PauseMenu" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 0 +theme_override_constants/margin_left = 150 +theme_override_constants/margin_top = 60 +theme_override_constants/margin_right = 150 +theme_override_constants/margin_bottom = 100 + +[node name="Pause" type="NinePatchRect" parent="."] +process_mode = 3 +z_index = 1 +layout_mode = 2 +texture = SubResource("AtlasTexture_tifvb") +patch_margin_left = 73 +patch_margin_top = 98 +patch_margin_right = 73 +patch_margin_bottom = 52 +script = ExtResource("2_4vp8g") +metadata/_edit_use_anchors_ = true + +[node name="MarginContainer" type="MarginContainer" parent="Pause"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 30 +theme_override_constants/margin_top = 55 +theme_override_constants/margin_right = 30 +theme_override_constants/margin_bottom = 10 + +[node name="Buttons" type="VBoxContainer" parent="Pause/MarginContainer"] +layout_mode = 2 + +[node name="PAUSED" type="Label" parent="Pause/MarginContainer/Buttons"] +layout_mode = 2 +text = "PAUSED" +label_settings = SubResource("LabelSettings_or0he") +horizontal_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="ContinueButton" type="Button" parent="Pause/MarginContainer/Buttons"] +layout_mode = 2 +icon = SubResource("AtlasTexture_4k24j") +icon_alignment = 1 + +[node name="RestartButton" type="Button" parent="Pause/MarginContainer/Buttons"] +layout_mode = 2 +icon = SubResource("AtlasTexture_or0he") +icon_alignment = 1 + +[node name="ExitButton" type="Button" parent="Pause/MarginContainer/Buttons"] +layout_mode = 2 +icon = SubResource("AtlasTexture_y3stn") +icon_alignment = 1 + +[node name="Audio" type="AudioStreamPlayer" parent="Pause"] +stream = ExtResource("3_e3p60") + +[connection signal="pressed" from="Pause/MarginContainer/Buttons/ContinueButton" to="Pause" method="Continue"] +[connection signal="pressed" from="Pause/MarginContainer/Buttons/RestartButton" to="Pause" method="Restart"] +[connection signal="pressed" from="Pause/MarginContainer/Buttons/ExitButton" to="Pause" method="Exit"] diff --git a/scenes/gui/runtime_gui.tscn b/scenes/gui/runtime_gui.tscn index 2fe6d95..bcf65d8 100644 --- a/scenes/gui/runtime_gui.tscn +++ b/scenes/gui/runtime_gui.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=3 uid="uid://cfnmspei3k4p7"] +[gd_scene load_steps=13 format=3 uid="uid://cfnmspei3k4p7"] [ext_resource type="PackedScene" uid="uid://ky35veswaytr" path="res://scenes/gui/sun_counter.tscn" id="1_le3od"] [ext_resource type="Theme" uid="uid://b8l285cjcgeyi" path="res://resources/themes/GameStyle.tres" id="1_xf6ra"] @@ -7,6 +7,7 @@ [ext_resource type="PackedScene" uid="uid://t0vpmycj6c8j" path="res://scenes/gui/shovel_button.tscn" id="3_bheea"] [ext_resource type="PackedScene" uid="uid://cgm7td1hgs0rr" path="res://scenes/gui/fast_forward_button.tscn" id="4_66uy4"] [ext_resource type="PackedScene" uid="uid://u5l3jd00s8vd" path="res://scenes/gui/pause_button.tscn" id="5_jyq78"] +[ext_resource type="PackedScene" uid="uid://b4lx8adw6rbqs" path="res://scenes/particles/dirt_explosion.tscn" id="6_5jtun"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ps2iw"] texture = ExtResource("2_eg3hk") @@ -112,6 +113,7 @@ size_flags_horizontal = 3 layout_mode = 2 size_flags_horizontal = 1 size_flags_vertical = 4 +particles = ExtResource("6_5jtun") [node name="FastForwardButton" parent="MarginContainer/Control/Hotbar" node_paths=PackedStringArray("flashAnimator") instance=ExtResource("4_66uy4")] layout_mode = 2 diff --git a/scenes/gui/sun_counter.tscn b/scenes/gui/sun_counter.tscn index cd91a76..d876cff 100644 --- a/scenes/gui/sun_counter.tscn +++ b/scenes/gui/sun_counter.tscn @@ -3,7 +3,7 @@ [ext_resource type="Texture2D" uid="uid://bhp3vuvwf7lak" path="res://assets/sprites/gui/suncounter.tres" id="1_e5x4k"] [ext_resource type="Theme" uid="uid://b8l285cjcgeyi" path="res://resources/themes/GameStyle.tres" id="1_vhhcn"] [ext_resource type="Texture2D" uid="uid://c47rflkf2wap0" path="res://assets/sprites/sun.tres" id="2_gugre"] -[ext_resource type="Script" path="res://scripts/components/gui/SunCounter.cs" id="3_qhmb8"] +[ext_resource type="Script" uid="uid://dwxohya1exdkh" path="res://scripts/components/gui/SunCounter.cs" id="3_qhmb8"] [sub_resource type="LabelSettings" id="LabelSettings_lxkq5"] font_size = 10 @@ -34,6 +34,7 @@ offset_bottom = 22.487 texture = ExtResource("2_gugre") [node name="Label" type="Label" parent="."] +process_mode = 3 layout_mode = 1 anchors_preset = -1 anchor_left = 0.122 diff --git a/scenes/level components/field_controller.tscn b/scenes/level components/field_controller.tscn index ac09786..4540853 100644 --- a/scenes/level components/field_controller.tscn +++ b/scenes/level components/field_controller.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=4 format=3 uid="uid://devn21c7luf45"] +[gd_scene load_steps=5 format=3 uid="uid://devn21c7luf45"] [ext_resource type="Shader" uid="uid://mt7vheq5modk" path="res://assets/shaders/greyscale.gdshader" id="1_d73yj"] [ext_resource type="Script" uid="uid://bj7rw2f6qu1lg" path="res://scripts/components/level/PlantField.cs" id="2_84bqh"] +[ext_resource type="PackedScene" uid="uid://b4lx8adw6rbqs" path="res://scenes/particles/dirt_explosion.tscn" id="3_ddnu6"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_0miwm"] shader = ExtResource("1_d73yj") @@ -10,6 +11,7 @@ shader_parameter/amount = 0.0 [node name="FieldController" type="Node2D"] material = SubResource("ShaderMaterial_0miwm") script = ExtResource("2_84bqh") +particles = ExtResource("3_ddnu6") [node name="Preview" type="Node2D" parent="."] process_mode = 4 diff --git a/scenes/level components/pools.tscn b/scenes/level components/pools.tscn index eeb93d8..8628f2a 100644 --- a/scenes/level components/pools.tscn +++ b/scenes/level components/pools.tscn @@ -2,12 +2,13 @@ [ext_resource type="Script" uid="uid://bso32xkw738sy" path="res://scripts/components/level/PoolContainer.cs" id="1_31ggc"] -[node name="Pools" type="Node2D" node_paths=PackedStringArray("Zombies", "Plants", "Projectiles", "Structures")] +[node name="Pools" type="Node2D" node_paths=PackedStringArray("Zombies", "Plants", "Projectiles", "Structures", "Particles")] script = ExtResource("1_31ggc") Zombies = NodePath("Zombies") Plants = NodePath("Plants") Projectiles = NodePath("Projectiles") Structures = NodePath("Structures") +Particles = NodePath("Particles") [node name="Zombies" type="Node2D" parent="."] z_index = 3 @@ -24,3 +25,5 @@ y_sort_enabled = true [node name="Structures" type="Node2D" parent="."] z_index = 2 y_sort_enabled = true + +[node name="Particles" type="Node2D" parent="."] diff --git a/scenes/particles/dirt_explosion.tscn b/scenes/particles/dirt_explosion.tscn new file mode 100644 index 0000000..5b23109 --- /dev/null +++ b/scenes/particles/dirt_explosion.tscn @@ -0,0 +1,73 @@ +[gd_scene load_steps=9 format=3 uid="uid://b4lx8adw6rbqs"] + +[ext_resource type="Texture2D" uid="uid://d3673b2idj18b" path="res://assets/sprites/particles/dirt1.tres" id="1_nc6dt"] +[ext_resource type="Script" uid="uid://dxcd70o6aa7pr" path="res://scripts/components/particles/StandardParticles.cs" id="1_o2lv2"] +[ext_resource type="Material" uid="uid://dmpscw60bfrj" path="res://assets/sprites/particles/dirt_material.tres" id="2_o2lv2"] +[ext_resource type="Texture2D" uid="uid://bs8cll4gtgwr1" path="res://assets/sprites/particles/dirt2.tres" id="3_0gemy"] +[ext_resource type="Texture2D" uid="uid://0tja7r7yp1ht" path="res://assets/sprites/particles/dirt3.tres" id="4_ihbjc"] +[ext_resource type="Texture2D" uid="uid://conyd86prykef" path="res://assets/sprites/particles/dirt4.tres" id="5_hu2fb"] +[ext_resource type="Texture2D" uid="uid://u6vxm6gejoss" path="res://assets/sprites/particles/dirt5.tres" id="6_bwqux"] +[ext_resource type="Texture2D" uid="uid://biooadlxqqeos" path="res://assets/sprites/particles/dirt6.tres" id="7_ee6l0"] + +[node name="DirtExplosion" type="Node2D"] +script = ExtResource("1_o2lv2") + +[node name="First" type="GPUParticles2D" parent="."] +emitting = false +amount = 3 +texture = ExtResource("1_nc6dt") +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("2_o2lv2") + +[node name="Second" type="GPUParticles2D" parent="."] +emitting = false +amount = 3 +texture = ExtResource("3_0gemy") +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("2_o2lv2") + +[node name="Third" type="GPUParticles2D" parent="."] +emitting = false +amount = 3 +texture = ExtResource("4_ihbjc") +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("2_o2lv2") + +[node name="Fourth" type="GPUParticles2D" parent="."] +emitting = false +amount = 3 +texture = ExtResource("5_hu2fb") +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("2_o2lv2") + +[node name="Fifth" type="GPUParticles2D" parent="."] +emitting = false +amount = 3 +texture = ExtResource("6_bwqux") +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("2_o2lv2") + +[node name="Sixth" type="GPUParticles2D" parent="."] +emitting = false +amount = 3 +texture = ExtResource("7_ee6l0") +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("2_o2lv2") diff --git a/scenes/particles/pea_particles.tscn b/scenes/particles/pea_particles.tscn new file mode 100644 index 0000000..9691f8a --- /dev/null +++ b/scenes/particles/pea_particles.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=6 format=3 uid="uid://1d33w4ubtury"] + +[ext_resource type="Script" uid="uid://dxcd70o6aa7pr" path="res://scripts/components/particles/StandardParticles.cs" id="1_rhijc"] +[ext_resource type="Texture2D" uid="uid://d1ovwgd03fxx5" path="res://assets/sprites/particles/pea_fragment1.tres" id="1_wg12m"] +[ext_resource type="Material" uid="uid://0sf0uy1dkxb6" path="res://assets/sprites/particles/pea_material.tres" id="2_rhijc"] +[ext_resource type="Texture2D" uid="uid://bmig582h4s38v" path="res://assets/sprites/particles/pea_fragment2.tres" id="3_yroe6"] +[ext_resource type="Texture2D" uid="uid://cg3nx7qj8kbkw" path="res://assets/sprites/particles/pea_fragment3.tres" id="4_bbhkw"] + +[node name="PeaParticles" type="Node2D"] +script = ExtResource("1_rhijc") + +[node name="First" type="GPUParticles2D" parent="."] +emitting = false +amount = 1 +texture = ExtResource("1_wg12m") +one_shot = true +explosiveness = 1.0 +process_material = ExtResource("2_rhijc") + +[node name="Second" type="GPUParticles2D" parent="."] +emitting = false +amount = 1 +texture = ExtResource("3_yroe6") +one_shot = true +explosiveness = 1.0 +randomness = 0.15 +process_material = ExtResource("2_rhijc") + +[node name="Third" type="GPUParticles2D" parent="."] +emitting = false +amount = 1 +texture = ExtResource("4_bbhkw") +one_shot = true +explosiveness = 1.0 +randomness = 0.15 +process_material = ExtResource("2_rhijc") diff --git a/scenes/particles/potato_explosion.tscn b/scenes/particles/potato_explosion.tscn new file mode 100644 index 0000000..1ce4899 --- /dev/null +++ b/scenes/particles/potato_explosion.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=7 format=3 uid="uid://ckanq33rao1ur"] + +[ext_resource type="PackedScene" uid="uid://b4lx8adw6rbqs" path="res://scenes/particles/dirt_explosion.tscn" id="1_c4q5e"] +[ext_resource type="Texture2D" uid="uid://cad45iyh16x5g" path="res://assets/sprites/particles/nachinka1.tres" id="2_lgu5b"] +[ext_resource type="Material" uid="uid://dvjxab8lnj6ap" path="res://assets/sprites/particles/potato_material.tres" id="3_lgu5b"] +[ext_resource type="Texture2D" uid="uid://b3yfl2had6t3o" path="res://assets/sprites/particles/nachinka2.tres" id="4_xwh7c"] +[ext_resource type="Texture2D" uid="uid://e5v4vpux4h8k" path="res://assets/sprites/particles/nachinka3.tres" id="5_ryjsf"] +[ext_resource type="Texture2D" uid="uid://dny6mfpspd3o8" path="res://assets/sprites/particles/nachinka4.tres" id="6_ursbv"] + +[node name="PotatoExplosion" instance=ExtResource("1_c4q5e")] + +[node name="Nachinka" type="GPUParticles2D" parent="." index="6"] +emitting = false +amount = 2 +texture = ExtResource("2_lgu5b") +lifetime = 2.0 +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("3_lgu5b") + +[node name="Nachinka2" type="GPUParticles2D" parent="." index="7"] +emitting = false +amount = 2 +texture = ExtResource("4_xwh7c") +lifetime = 2.0 +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("3_lgu5b") + +[node name="Nachinka3" type="GPUParticles2D" parent="." index="8"] +emitting = false +amount = 2 +texture = ExtResource("5_ryjsf") +lifetime = 2.0 +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("3_lgu5b") + +[node name="Nachinka4" type="GPUParticles2D" parent="." index="9"] +emitting = false +amount = 2 +texture = ExtResource("6_ursbv") +lifetime = 2.0 +one_shot = true +explosiveness = 1.0 +randomness = 0.11 +local_coords = true +process_material = ExtResource("3_lgu5b") diff --git a/scenes/particles/snow_pea_particles.tscn b/scenes/particles/snow_pea_particles.tscn new file mode 100644 index 0000000..76e30a6 --- /dev/null +++ b/scenes/particles/snow_pea_particles.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=5 format=3 uid="uid://cijchi3f01q2t"] + +[ext_resource type="PackedScene" uid="uid://1d33w4ubtury" path="res://scenes/particles/pea_particles.tscn" id="1_5fx7g"] +[ext_resource type="Texture2D" uid="uid://el3weu727cmo" path="res://assets/sprites/particles/snowpea_fragment1.tres" id="2_fb47t"] +[ext_resource type="Texture2D" uid="uid://rv2ibl8ls1kh" path="res://assets/sprites/particles/snowpea_fragment2.tres" id="3_5frrb"] +[ext_resource type="Texture2D" uid="uid://bgg1n8802ebm6" path="res://assets/sprites/particles/snowpea_fragment3.tres" id="4_hwfh3"] + +[node name="SnowPeaParticles" instance=ExtResource("1_5fx7g")] + +[node name="First" parent="." index="0"] +texture = ExtResource("2_fb47t") + +[node name="Second" parent="." index="1"] +texture = ExtResource("3_5frrb") + +[node name="Third" parent="." index="2"] +texture = ExtResource("4_hwfh3") diff --git a/scenes/projectiles/pea.tscn b/scenes/projectiles/pea.tscn index 48d33f1..123dd6f 100644 --- a/scenes/projectiles/pea.tscn +++ b/scenes/projectiles/pea.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"] +[gd_scene load_steps=5 format=3 uid="uid://b2hrv0aqbui7u"] [ext_resource type="Script" uid="uid://dxlwvwy3hj56x" path="res://scripts/components/LinearProjectile.cs" id="1_3kc4s"] [ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"] +[ext_resource type="PackedScene" uid="uid://1d33w4ubtury" path="res://scenes/particles/pea_particles.tscn" id="2_osqrk"] [sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"] radius = 6.0 @@ -12,6 +13,7 @@ collision_mask = 8 script = ExtResource("1_3kc4s") _speed = 3.0 _damage = 10 +particles = ExtResource("2_osqrk") [node name="Sprite" type="Sprite2D" parent="."] texture = ExtResource("2_26q5x") diff --git a/scenes/projectiles/snowpea_projectile.tscn b/scenes/projectiles/snowpea_projectile.tscn index 0f46653..001c48a 100644 --- a/scenes/projectiles/snowpea_projectile.tscn +++ b/scenes/projectiles/snowpea_projectile.tscn @@ -1,8 +1,12 @@ -[gd_scene load_steps=5 format=3 uid="uid://domeukw4ucmyr"] +[gd_scene load_steps=9 format=3 uid="uid://domeukw4ucmyr"] [ext_resource type="Script" uid="uid://dxlwvwy3hj56x" path="res://scripts/components/LinearProjectile.cs" id="1_fkydi"] [ext_resource type="Resource" uid="uid://7uj0oe656jfx" path="res://resources/effects/SnowSlow.tres" id="2_fn62x"] [ext_resource type="Texture2D" uid="uid://dn4l67snkx5mr" path="res://assets/sprites/plants/snowpea_projectile.tres" id="2_xt8td"] +[ext_resource type="PackedScene" uid="uid://cijchi3f01q2t" path="res://scenes/particles/snow_pea_particles.tscn" id="3_t6hp0"] +[ext_resource type="Texture2D" uid="uid://dejgsyw4f2crg" path="res://assets/sprites/particles/snowpea_flake1.tres" id="5_1u1j3"] +[ext_resource type="Material" uid="uid://bflocbxbpv73j" path="res://assets/sprites/particles/snowflake.tres" id="6_pcdfd"] +[ext_resource type="Texture2D" uid="uid://deiu2jr26meq" path="res://assets/sprites/particles/snowpea_flake2.tres" id="7_xke8y"] [sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"] radius = 6.0 @@ -15,6 +19,7 @@ _speed = 3.0 _damage = 10 _impactEffect = ExtResource("2_fn62x") _damageType = 1 +particles = ExtResource("3_t6hp0") [node name="Sprite" type="Sprite2D" parent="."] texture = ExtResource("2_xt8td") @@ -27,5 +32,24 @@ wait_time = 15.0 one_shot = true autostart = true +[node name="Particles1" type="GPUParticles2D" parent="."] +position = Vector2(-5, 0) +amount = 1 +texture = ExtResource("5_1u1j3") +process_material = ExtResource("6_pcdfd") + +[node name="Particles2" type="GPUParticles2D" parent="."] +position = Vector2(5, 0) +emitting = false +amount = 1 +texture = ExtResource("7_xke8y") +process_material = ExtResource("6_pcdfd") + +[node name="Timer" type="Timer" parent="Particles2"] +wait_time = 0.2 +one_shot = true +autostart = true + [connection signal="area_entered" from="." to="." method="OnAreaEntered"] [connection signal="timeout" from="Timer" to="." method="queue_free"] +[connection signal="timeout" from="Particles2/Timer" to="Particles2" method="set_emitting" binds= [true]] diff --git a/scenes/prototype_survival.tscn b/scenes/prototype_survival.tscn index b31fbbb..b7918b5 100644 --- a/scenes/prototype_survival.tscn +++ b/scenes/prototype_survival.tscn @@ -6,7 +6,7 @@ [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://c1ctn2bvt4cpq" path="res://scenes/gui/pause.tscn" id="7_3ghv7"] +[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/components/level/SunSpawner.cs" id="7_gnb05"] [ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="8_8nyym"] [ext_resource type="Script" uid="uid://bsuw5lvnr3kol" path="res://scripts/components/level/zombe_spawners/ZombieSequencer.cs" id="9_8nyym"] @@ -37,12 +37,13 @@ metadata/_edit_lock_ = true position = Vector2(481, 200) metadata/_edit_lock_ = true -[node name="Pools" type="Node2D" parent="." node_paths=PackedStringArray("Zombies", "Plants", "Projectiles", "Structures")] +[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 @@ -60,6 +61,9 @@ y_sort_enabled = true z_index = 2 y_sort_enabled = true +[node name="Particles" type="Node2D" parent="Pools"] +z_index = 5 + [node name="Overlay" type="CanvasLayer" parent="."] layer = 6 follow_viewport_enabled = true @@ -75,7 +79,7 @@ metadata/_edit_lock_ = true [node name="ChooseYourSeeds" parent="GUI" instance=ExtResource("6_btfw3")] metadata/_edit_lock_ = true -[node name="Pause" parent="GUI" instance=ExtResource("7_3ghv7")] +[node name="PauseMenu" parent="GUI" instance=ExtResource("7_3ghv7")] visible = false [node name="SunSpawner" type="Node" parent="."] diff --git a/scripts/components/LinearProjectile.cs b/scripts/components/LinearProjectile.cs index d2ec06a..156c486 100644 --- a/scripts/components/LinearProjectile.cs +++ b/scripts/components/LinearProjectile.cs @@ -1,4 +1,5 @@ using Godot; +using Newlon.Components.Level; using Newlon.Systems.Effects; namespace Newlon.Components; @@ -17,6 +18,8 @@ public partial class LinearProjectile : Area2D, IProjectile private Effect _impactEffect; [Export] private Utility.DamageTypes _damageType = Utility.DamageTypes.PHYSICAL; + [Export] + private PackedScene particles; private int _line; private bool used = false; public int Line { get => _line; set { _line = value; } } @@ -37,6 +40,9 @@ public partial class LinearProjectile : Area2D, IProjectile used = true; if (entity is IEffectHandler effectHandler && _impactEffect != null) effectHandler.GiveEffect(_impactEffect); + + PoolContainer.Instance.SpawnParticles(particles, GlobalPosition); + QueueFree(); } } diff --git a/scripts/components/gui/PauseMenu.cs b/scripts/components/gui/PauseMenu.cs index 3ebcf1b..75fa61f 100644 --- a/scripts/components/gui/PauseMenu.cs +++ b/scripts/components/gui/PauseMenu.cs @@ -11,7 +11,7 @@ public partial class PauseMenu : Control public void Continue() { - Visible = false; + GetParent().Visible = false; GetTree().Paused = false; } public void Restart() @@ -26,7 +26,7 @@ public partial class PauseMenu : Control } public static void Pause() { - Instance.Visible = true; + Instance.GetParent().Visible = true; Instance.GetTree().Paused = true; } } diff --git a/scripts/components/gui/ShovelButton.cs b/scripts/components/gui/ShovelButton.cs index a588d25..b08008a 100644 --- a/scripts/components/gui/ShovelButton.cs +++ b/scripts/components/gui/ShovelButton.cs @@ -6,6 +6,7 @@ namespace Newlon.Components.GUI; public partial class ShovelButton : TextureButton { + [Export] private PackedScene particles; private void OnFocusExited() { ButtonPressed = false; @@ -27,7 +28,10 @@ public partial class ShovelButton : TextureButton { if (PoolContainer.Instance.EntityField[i].TryGetValue(checkedPosition, out var entity) && entity is RuntimePlantData plantData) { - plantData.Kill(); + plantData.Kill(); + + PoolContainer.Instance.SpawnParticles(particles, plantData.GlobalPosition + Vector2.Down * Utility.TileHeight/2.0f); + break; } } diff --git a/scripts/components/level/PlantField.cs b/scripts/components/level/PlantField.cs index f8bbc11..ef6c96b 100644 --- a/scripts/components/level/PlantField.cs +++ b/scripts/components/level/PlantField.cs @@ -10,7 +10,7 @@ public partial class PlantField : Node2D private PlantResource _resource; private Seedpacket _slot; private bool _previousCanPlace; - + [Export] private PackedScene particles; public static PlantField Instance {get; private set;} public override void _Ready() @@ -97,6 +97,8 @@ public partial class PlantField : Node2D RuntimeLevelData.Instance.SpendSun(_resource.Cost); + PoolContainer.Instance.SpawnParticles(particles, plant.GlobalPosition + Vector2.Down * Utility.TileHeight/2.0f); + // Unfocusing and recharging slot _slot.Recharge(); } diff --git a/scripts/components/level/PoolContainer.cs b/scripts/components/level/PoolContainer.cs index 1f22d52..2714860 100644 --- a/scripts/components/level/PoolContainer.cs +++ b/scripts/components/level/PoolContainer.cs @@ -18,8 +18,10 @@ public partial class PoolContainer : Node2D public Node2D Projectiles { get; private set; } [Export] public Node2D Structures { get; private set; } + [Export] + public Node2D Particles { get; private set; } - public static PoolContainer Instance {get; private set;} + public static PoolContainer Instance { get; private set; } public Dictionary[] EntityField = { new(), new(), new() }; public override void _Ready() @@ -27,31 +29,38 @@ public partial class PoolContainer : Node2D Instance = this; } public bool TryGetEntity(Vector2 key, out IEntity result, int layer = 1) - { - if (EntityField[layer].ContainsKey(key)) - { - result = EntityField[layer][key]; - } - else - { - result = null; - } - return EntityField[layer].ContainsKey(key) + { + if (EntityField[layer].ContainsKey(key)) + { + result = EntityField[layer][key]; + } + else + { + result = null; + } + return EntityField[layer].ContainsKey(key) && EntityField[layer][key] != null; - } + } public bool TryGetEntity(Vector2 key, out T result, int layer = 1) where T : class { if (EntityField[layer].ContainsKey(key)) - { - result = EntityField[layer][key] as T; - } - else - { - result = null; - } - return EntityField[layer].ContainsKey(key) + { + result = EntityField[layer][key] as T; + } + else + { + result = null; + } + return EntityField[layer].ContainsKey(key) && EntityField[layer][key] != null && result != null; } + + public void SpawnParticles(PackedScene particles, Vector2 position) + { + var emitter = particles.Instantiate(); + Instance.Particles.AddChild(emitter); + emitter.GlobalPosition = position; + } } diff --git a/scripts/components/particles/StandardParticles.cs b/scripts/components/particles/StandardParticles.cs new file mode 100644 index 0000000..bad26a8 --- /dev/null +++ b/scripts/components/particles/StandardParticles.cs @@ -0,0 +1,22 @@ +using Godot; + +public partial class StandardParticles : Node2D +{ + private int counter = 0; + private int counterMax = 0; + public override void _Ready() + { + foreach (GpuParticles2D emitter in GetChildren()) + { + emitter.Emitting = true; + counterMax += 1; + emitter.Finished += MarkForDestruction; + } + } + public void MarkForDestruction() + { + if (Engine.IsEditorHint()) return; + if (++counter < counterMax) return; + QueueFree(); + } +} diff --git a/scripts/components/particles/StandardParticles.cs.uid b/scripts/components/particles/StandardParticles.cs.uid new file mode 100644 index 0000000..e7e5be0 --- /dev/null +++ b/scripts/components/particles/StandardParticles.cs.uid @@ -0,0 +1 @@ +uid://dxcd70o6aa7pr diff --git a/scripts/components/plants/ExplosionComponent.cs b/scripts/components/plants/ExplosionComponent.cs index 01797b3..c8d3750 100644 --- a/scripts/components/plants/ExplosionComponent.cs +++ b/scripts/components/plants/ExplosionComponent.cs @@ -1,4 +1,5 @@ using Godot; +using Newlon.Components.Level; using Newlon.Components.Zombies; namespace Newlon.Components.Plants; @@ -6,15 +7,19 @@ namespace Newlon.Components.Plants; public partial class ExplosionComponent : Area2D { [Export] private int damage; + [Export] private PackedScene particles; public void Explode() { - foreach(var zombie in GetOverlappingAreas()) + foreach (var zombie in GetOverlappingAreas()) { var zombieData = zombie.GetParent(); - zombieData?.TakeDamage(damage,GetParent()); + zombieData?.TakeDamage(damage, GetParent()); } + PoolContainer.Instance.SpawnParticles(particles, GetParent().GlobalPosition); + GetParent().Kill(); + } }