From 041343a183539fb998dbc045a2337c0abaee31bf Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Fri, 14 Feb 2025 13:21:07 +0300 Subject: [PATCH] coin particles, fixes to sync, water bomb portal as a disk --- assets/coin.png | Bin 0 -> 1048 bytes assets/coin.png.import | 35 ++++++++++++++++++++++ assets/coin_flower.png.import | 6 ++-- src/ingame/bomb.gd | 6 +++- src/ingame/item_bomb.tscn | 54 ++++++++++++++++++++++++++++++++-- src/ingame/pipe.tscn | 14 ++++----- 6 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 assets/coin.png create mode 100644 assets/coin.png.import diff --git a/assets/coin.png b/assets/coin.png new file mode 100644 index 0000000000000000000000000000000000000000..1b13ae6c194b2f5d243723da174da611da051811 GIT binary patch literal 1048 zcmZXSVQ3p=7{~u}S(lAg!`lWAtl z==y9fz6L%^&H!t%qid(g5r?HMkN4tg+o_&5 z5I`d!0<(4rkZHlCe|ZF@v^ef-j__KI6^St`3`TSZvW!ed^}C#53}6D74@?46z!LCV zDIPqav|IT)dS6kOb~e)rh;m8^`}z;r9G6D zXi6nRBU7ic5eh<<5ZwcfAv2ErB+OY@kU)Z$JYkZeq$Wwrl3pYOem`Ux(I_+xnGEuIm?o-K{&kt^ajGYYGE^@Rm53Jj ztxi8$Wq6|yHAors=ds5`yvq9}q{x#YDMxC7k|okFkx}6`a6t-e3D{DwaY4piL4u1s zK9c%LO;GYU={YiH$%T*`ir?x;TE>)uQWRA_1`NdQ8DF($a@C%aP74MF5gNemI1V1c zu}|^ES$usF^A#*!dvNLZC$2Ab{`tqijg1T#=u*n*P6-7#{v_lFyi`s(hCC+MfR5WzK72J>9+NxORDn!+kNaFV_3| zQ0%S9eg&QTBSUXLc~bA)%S)$%0sl_#(ThD7nx@_MuJtP&>*o%=`Lla^&BTwh?GK1! zgEPfM|Dj#ql%M)-di%N2u}#m6o}K^r-W$ih>f7hAf4*X$5NscQ?>XlmYy1j_~ void: get_node("/root/Main").add_inventory_item.rpc(&"coin", item.sells_for * item_bundle["count"]) if _sell_sound != null: _sell_sound.play() + if _sell_particles != null: + _sell_particles.amount = item.sells_for * item_bundle["count"] + _sell_particles.emitting = true is_dead = true _model.hide() _disable_body.rpc() - await _sell_sound.finished + await _sell_particles.finished queue_free() return diff --git a/src/ingame/item_bomb.tscn b/src/ingame/item_bomb.tscn index dcd68ae..587e53d 100644 --- a/src/ingame/item_bomb.tscn +++ b/src/ingame/item_bomb.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=11 format=3 uid="uid://bpvbnlhpth4w7"] +[gd_scene load_steps=17 format=3 uid="uid://bpvbnlhpth4w7"] [ext_resource type="Script" path="res://src/ingame/bomb.gd" id="1_27lur"] [ext_resource type="PackedScene" uid="uid://dxb5f3il2h1ur" path="res://src/ingame/quad_viewmodel.tscn" id="2_fy6j6"] [ext_resource type="AudioStream" uid="uid://dy3ngeohp1uqf" path="res://assets/sfx/land.wav" id="3_1vo65"] [ext_resource type="AudioStream" uid="uid://dkxv7wbq8s1gs" path="res://assets/sfx/coinsplash.ogg" id="4_fyu6c"] +[ext_resource type="Texture2D" uid="uid://dgo2frvws2o6f" path="res://assets/coin.png" id="5_om8wy"] [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0ebrr"] properties/0/path = NodePath(".:position") @@ -21,6 +22,15 @@ properties/3/replication_mode = 2 properties/4/path = NodePath("Model:visible") properties/4/spawn = true properties/4/replication_mode = 2 +properties/5/path = NodePath("SellParticles:emitting") +properties/5/spawn = true +properties/5/replication_mode = 2 +properties/6/path = NodePath("DropSound:playing") +properties/6/spawn = true +properties/6/replication_mode = 2 +properties/7/path = NodePath("SellSound:playing") +properties/7/spawn = true +properties/7/replication_mode = 2 [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_v7dnr"] albedo_color = Color(0, 1, 1, 1) @@ -43,11 +53,40 @@ radius = 0.2 [sub_resource type="SphereShape3D" id="SphereShape3D_y6453"] radius = 1.5 -[node name="ItemBomb" type="Node3D" node_paths=PackedStringArray("_splash_small_sound", "_sell_sound", "_model", "_picking_area", "body")] +[sub_resource type="Gradient" id="Gradient_qoklw"] +offsets = PackedFloat32Array(0.0454545, 0.836364, 0.981818) +colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_fdtmr"] +gradient = SubResource("Gradient_qoklw") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_yncjw"] +lifetime_randomness = 0.2 +inherit_velocity_ratio = 0.1 +direction = Vector3(0, 1, 0) +spread = 180.0 +initial_velocity_max = 3.0 +gravity = Vector3(0, 0, 0) +linear_accel_min = -6.9 +linear_accel_max = -3.45 +color_ramp = SubResource("GradientTexture1D_fdtmr") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ooyci"] +transparency = 1 +shading_mode = 0 +vertex_color_use_as_albedo = true +albedo_texture = ExtResource("5_om8wy") + +[sub_resource type="QuadMesh" id="QuadMesh_4d5bh"] +material = SubResource("StandardMaterial3D_ooyci") +size = Vector2(0.25, 0.25) + +[node name="ItemBomb" type="Node3D" node_paths=PackedStringArray("_splash_small_sound", "_sell_sound", "_model", "_sell_particles", "_picking_area", "body")] script = ExtResource("1_27lur") _splash_small_sound = NodePath("DropSound") _sell_sound = NodePath("SellSound") _model = NodePath("Model") +_sell_particles = NodePath("SellParticles") _picking_area = NodePath("PickingArea") body = NodePath("RigidBody3D") billboard = true @@ -107,6 +146,17 @@ stream = ExtResource("4_fyu6c") volume_db = 2.0 bus = &"SoundEffects" +[node name="SellParticles" type="GPUParticles3D" parent="."] +emitting = false +amount = 32 +lifetime = 2.0 +one_shot = true +speed_scale = 0.5 +explosiveness = 1.0 +randomness = 0.4 +process_material = SubResource("ParticleProcessMaterial_yncjw") +draw_pass_1 = SubResource("QuadMesh_4d5bh") + [connection signal="body_entered" from="RigidBody3D" to="." method="_on_body_entered"] [connection signal="area_entered" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_entered"] [connection signal="area_exited" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_exited"] diff --git a/src/ingame/pipe.tscn b/src/ingame/pipe.tscn index 13fcd49..dc7fbb7 100644 --- a/src/ingame/pipe.tscn +++ b/src/ingame/pipe.tscn @@ -3,13 +3,13 @@ [ext_resource type="Script" path="res://src/ingame/pipe.gd" id="1_ckmpn"] [ext_resource type="PackedScene" uid="uid://tdsbo3e5ic86" path="res://src/ingame/water_bomb.tscn" id="2_3sfu2"] -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bgwg2"] -cull_mode = 2 -albedo_color = Color(0.0313726, 1, 1, 1) +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ecwtt"] +albedo_color = Color(0, 1, 1, 1) -[sub_resource type="PlaneMesh" id="PlaneMesh_g3bb5"] -lightmap_size_hint = Vector2i(12, 12) -material = SubResource("StandardMaterial3D_bgwg2") +[sub_resource type="SphereMesh" id="SphereMesh_504u5"] +material = SubResource("StandardMaterial3D_ecwtt") +height = 0.001 +rings = 1 [node name="Pipe" type="Node3D" node_paths=PackedStringArray("_projectile_holder", "_production_timer")] script = ExtResource("1_ckmpn") @@ -22,7 +22,7 @@ _spawnable_scenes = PackedStringArray("res://src/ingame/water_bomb.tscn") spawn_path = NodePath("../ProjectileHolder") [node name="MeshInstance3D" type="MeshInstance3D" parent="."] -mesh = SubResource("PlaneMesh_g3bb5") +mesh = SubResource("SphereMesh_504u5") [node name="ProjectileHolder" type="Node" parent="."]