From 0e5dee50f7914caad064e0372e5497c6f0912796 Mon Sep 17 00:00:00 2001 From: Rendo Date: Sat, 28 Jun 2025 02:44:42 +0500 Subject: [PATCH] Particles system --- assets/sprites/atlases/atlas2.png | Bin 5122 -> 7021 bytes assets/sprites/particles/dirt1.tres | 7 + assets/sprites/particles/dirt2.tres | 7 + assets/sprites/particles/dirt3.tres | 7 + assets/sprites/particles/dirt4.tres | 7 + assets/sprites/particles/dirt5.tres | 7 + assets/sprites/particles/dirt6.tres | 7 + assets/sprites/particles/dirt_material.tres | 29 ++++ assets/sprites/particles/nachinka1.tres | 7 + assets/sprites/particles/nachinka2.tres | 7 + assets/sprites/particles/nachinka3.tres | 7 + assets/sprites/particles/nachinka4.tres | 7 + assets/sprites/particles/pea_fragment1.tres | 7 + assets/sprites/particles/pea_fragment2.tres | 7 + assets/sprites/particles/pea_fragment3.tres | 7 + assets/sprites/particles/pea_material.tres | 28 +++ assets/sprites/particles/potato_material.tres | 31 ++++ assets/sprites/particles/snowflake.tres | 29 ++++ assets/sprites/particles/snowpea_flake1.tres | 7 + assets/sprites/particles/snowpea_flake2.tres | 7 + .../sprites/particles/snowpea_fragment1.tres | 7 + .../sprites/particles/snowpea_fragment2.tres | 7 + .../sprites/particles/snowpea_fragment3.tres | 7 + project.godot | 3 +- scenes/entities/plants/potato_mine.tscn | 4 +- scenes/gui/pause.tscn | 163 ------------------ scenes/gui/pause_menu.tscn | 93 ++++++++++ scenes/gui/runtime_gui.tscn | 4 +- scenes/gui/sun_counter.tscn | 3 +- scenes/level components/field_controller.tscn | 4 +- scenes/level components/pools.tscn | 5 +- scenes/particles/dirt_explosion.tscn | 73 ++++++++ scenes/particles/pea_particles.tscn | 36 ++++ scenes/particles/potato_explosion.tscn | 54 ++++++ scenes/particles/snow_pea_particles.tscn | 17 ++ scenes/projectiles/pea.tscn | 4 +- scenes/projectiles/snowpea_projectile.tscn | 26 ++- scenes/prototype_survival.tscn | 10 +- scripts/components/LinearProjectile.cs | 6 + scripts/components/gui/PauseMenu.cs | 4 +- scripts/components/gui/ShovelButton.cs | 6 +- scripts/components/level/PlantField.cs | 4 +- scripts/components/level/PoolContainer.cs | 49 +++--- .../components/particles/StandardParticles.cs | 22 +++ .../particles/StandardParticles.cs.uid | 1 + .../components/plants/ExplosionComponent.cs | 9 +- 46 files changed, 643 insertions(+), 200 deletions(-) create mode 100644 assets/sprites/particles/dirt1.tres create mode 100644 assets/sprites/particles/dirt2.tres create mode 100644 assets/sprites/particles/dirt3.tres create mode 100644 assets/sprites/particles/dirt4.tres create mode 100644 assets/sprites/particles/dirt5.tres create mode 100644 assets/sprites/particles/dirt6.tres create mode 100644 assets/sprites/particles/dirt_material.tres create mode 100644 assets/sprites/particles/nachinka1.tres create mode 100644 assets/sprites/particles/nachinka2.tres create mode 100644 assets/sprites/particles/nachinka3.tres create mode 100644 assets/sprites/particles/nachinka4.tres create mode 100644 assets/sprites/particles/pea_fragment1.tres create mode 100644 assets/sprites/particles/pea_fragment2.tres create mode 100644 assets/sprites/particles/pea_fragment3.tres create mode 100644 assets/sprites/particles/pea_material.tres create mode 100644 assets/sprites/particles/potato_material.tres create mode 100644 assets/sprites/particles/snowflake.tres create mode 100644 assets/sprites/particles/snowpea_flake1.tres create mode 100644 assets/sprites/particles/snowpea_flake2.tres create mode 100644 assets/sprites/particles/snowpea_fragment1.tres create mode 100644 assets/sprites/particles/snowpea_fragment2.tres create mode 100644 assets/sprites/particles/snowpea_fragment3.tres delete mode 100644 scenes/gui/pause.tscn create mode 100644 scenes/gui/pause_menu.tscn create mode 100644 scenes/particles/dirt_explosion.tscn create mode 100644 scenes/particles/pea_particles.tscn create mode 100644 scenes/particles/potato_explosion.tscn create mode 100644 scenes/particles/snow_pea_particles.tscn create mode 100644 scripts/components/particles/StandardParticles.cs create mode 100644 scripts/components/particles/StandardParticles.cs.uid diff --git a/assets/sprites/atlases/atlas2.png b/assets/sprites/atlases/atlas2.png index 4f2a2addedab80698fd2d5f04f07495cdc69e7c5..2e0fca80d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aRcy7zaNJ?CeYh?*Cdx>j}*xd+_44v;CHS~U?A8Il|5-cwz5v2E* zki4nKj};fbT9ENV-_6f4~pVYh%+mRRtMyooFD z{?Tl+#4eCAZ=P7iZQFy^Ns_-E_9IOvRVqw$7PRQjAz{ceQg%|!?%jP?I)Wf6VBB(G z*QO%M8f<(iHMX*EkYC-it(Sj~X-l0h%i``8FAA}n#glR{3mXPE-!Lj`L@bb+caKMr zuin9>Nn)s=J`UxF-aqphbFG6a+;&05emiZ>Yz8x4w^_QT_%?L{00ijSTMJEH9(N*~ zLiODPiySqg);I^6OUgR_cY7nxGg&H=)vvWIj;n!k?R4|gPo}n(hZt50Bbkq*ZVHIF zzpH`Te|%K^FaJQ)=mATLj2KSY%ar95{Q~>1Iz}!@;U~rP_b7t|ebs%;#Vp#SdH&Oy zC2>Zzd_*3+5-iY`Z`f3453!0ixbY^5V5dXo>{MD-X~!uvIqpP%Cg za(qXJN#Tv|@S`QPj~U!6=Rv`(stpW?N)Uv+nl~c*YCek}=82ge7=mKQ5`O(662*)V z6pS(nie=#l){5>WQ^mrpg;yswM;wNQq_s0lX54z$@W`)85nP&#s90;u2F>tOrsC#g zf;O?9w>G}HIwXVufcx!h5+0Q==?Wz(#1kZfWIK4RhN=qk)PpsTx;Jx@7xA`!c}68N z;V*`T=jUYIk;T-}^>vev^0J20Pf|N}t&-thPA2FX* A>;M1& 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(); + } }