diff --git a/assets/coin.png b/assets/coin.png new file mode 100644 index 0000000..1b13ae6 Binary files /dev/null and b/assets/coin.png differ diff --git a/assets/coin.png.import b/assets/coin.png.import new file mode 100644 index 0000000..5c5c85b --- /dev/null +++ b/assets/coin.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dgo2frvws2o6f" +path.s3tc="res://.godot/imported/coin.png-f04b9cd408b88aba3ab0966b4da32df0.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/coin.png" +dest_files=["res://.godot/imported/coin.png-f04b9cd408b88aba3ab0966b4da32df0.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/coin_flower.png.import b/assets/coin_flower.png.import index 14ef776..7e487f8 100644 --- a/assets/coin_flower.png.import +++ b/assets/coin_flower.png.import @@ -3,7 +3,7 @@ importer="texture" type="CompressedTexture2D" uid="uid://dw3x3h3f34sy3" -path.s3tc="res://.godot/imported/coin_flower.png-f7e515b96b6729484a68167e84f6e510.s3tc.ctex" +path.bptc="res://.godot/imported/coin_flower.png-f7e515b96b6729484a68167e84f6e510.bptc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -12,12 +12,12 @@ metadata={ [deps] source_file="res://assets/coin_flower.png" -dest_files=["res://.godot/imported/coin_flower.png-f7e515b96b6729484a68167e84f6e510.s3tc.ctex"] +dest_files=["res://.godot/imported/coin_flower.png-f7e515b96b6729484a68167e84f6e510.bptc.ctex"] [params] compress/mode=2 -compress/high_quality=false +compress/high_quality=true compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 diff --git a/src/ingame/bomb.gd b/src/ingame/bomb.gd index 1045f22..94e04e5 100644 --- a/src/ingame/bomb.gd +++ b/src/ingame/bomb.gd @@ -6,6 +6,7 @@ class_name Bomb extends Node3D @export var _sell_sound: AudioStreamPlayer3D @export var _model: Node3D @export var _splash_particles: GPUParticles3D +@export var _sell_particles: GPUParticles3D @export var _picking_area: Area3D @export var body: RigidBody3D @export var billboard := false @@ -86,10 +87,13 @@ func _on_body_entered(p_body: Node3D) -> 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="."]