coin particles, fixes to sync, water bomb portal as a disk

This commit is contained in:
veclavtalica 2025-02-14 13:21:07 +03:00
parent 1e5f6990ad
commit 041343a183
6 changed files with 102 additions and 13 deletions

BIN
assets/coin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

35
assets/coin.png.import Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"]

View File

@ -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="."]