generated from krampus/template-godot4
Compare commits
4 Commits
0edf520a21
...
d9e5b72041
Author | SHA1 | Date | |
---|---|---|---|
d9e5b72041 | |||
bbb8a1e231 | |||
e25bede7f6 | |||
065b9521b6 |
BIN
asset_dev/sfx/635106__joedeshon__thumping_on_a_plastic_bottle.wav
(Stored with Git LFS)
Normal file
BIN
asset_dev/sfx/635106__joedeshon__thumping_on_a_plastic_bottle.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
asset_dev/sfx/collect.aup3
Normal file
BIN
asset_dev/sfx/collect.aup3
Normal file
Binary file not shown.
BIN
assets/sfx/tools/collect5.wav
(Stored with Git LFS)
Normal file
BIN
assets/sfx/tools/collect5.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/sfx/tools/collect5.wav.import
Normal file
24
assets/sfx/tools/collect5.wav.import
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamWAV"
|
||||||
|
uid="uid://cof6pg6yadsac"
|
||||||
|
path="res://.godot/imported/collect5.wav-9560532de8bcb52b4f7fb8f0325d4125.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/sfx/tools/collect5.wav"
|
||||||
|
dest_files=["res://.godot/imported/collect5.wav-9560532de8bcb52b4f7fb8f0325d4125.sample"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
@ -118,7 +118,7 @@ seamless = true
|
|||||||
seamless_blend_skirt = 0.5
|
seamless_blend_skirt = 0.5
|
||||||
noise = ExtResource("7_7cbja")
|
noise = ExtResource("7_7cbja")
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_aix42"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qjnj2"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
render_priority = 0
|
render_priority = 0
|
||||||
shader = ExtResource("6_6frcc")
|
shader = ExtResource("6_6frcc")
|
||||||
@ -306,7 +306,7 @@ unique_name_in_owner = true
|
|||||||
body = NodePath("..")
|
body = NodePath("..")
|
||||||
mesh_instance = NodePath("../..")
|
mesh_instance = NodePath("../..")
|
||||||
initial_mask = ExtResource("5_aix42")
|
initial_mask = ExtResource("5_aix42")
|
||||||
source_gunk_material = SubResource("ShaderMaterial_aix42")
|
source_gunk_material = SubResource("ShaderMaterial_qjnj2")
|
||||||
|
|
||||||
[node name="Bulkhead" parent="." instance=ExtResource("8_ujrcv")]
|
[node name="Bulkhead" parent="." instance=ExtResource("8_ujrcv")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.5, 0, -2)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.5, 0, -2)
|
||||||
|
@ -164,7 +164,6 @@ collision_mode = 2
|
|||||||
|
|
||||||
[node name="GrunkSplatter" type="GPUParticles3D"]
|
[node name="GrunkSplatter" type="GPUParticles3D"]
|
||||||
sorting_offset = 9.0
|
sorting_offset = 9.0
|
||||||
emitting = false
|
|
||||||
amount = 64
|
amount = 64
|
||||||
lifetime = 0.3
|
lifetime = 0.3
|
||||||
one_shot = true
|
one_shot = true
|
||||||
@ -176,7 +175,6 @@ script = ExtResource("2_grvat")
|
|||||||
[node name="SubSplatter" type="GPUParticles3D" parent="."]
|
[node name="SubSplatter" type="GPUParticles3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
sorting_offset = 9.0
|
sorting_offset = 9.0
|
||||||
emitting = false
|
|
||||||
amount = 4
|
amount = 4
|
||||||
lifetime = 0.3
|
lifetime = 0.3
|
||||||
one_shot = true
|
one_shot = true
|
||||||
@ -211,7 +209,6 @@ shape = SubResource("SphereShape3D_6adkd")
|
|||||||
[node name="GrunkDust" parent="." instance=ExtResource("7_opa8j")]
|
[node name="GrunkDust" parent="." instance=ExtResource("7_opa8j")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
|
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
|
||||||
emitting = false
|
|
||||||
amount = 512
|
amount = 512
|
||||||
lifetime = 1.2
|
lifetime = 1.2
|
||||||
one_shot = true
|
one_shot = true
|
||||||
|
46
src/player/grunk_collection_sfx/grunk_collection_sfx.gd
Normal file
46
src/player/grunk_collection_sfx/grunk_collection_sfx.gd
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
extends AudioStreamPlayer
|
||||||
|
|
||||||
|
@export var interval := 200.0
|
||||||
|
|
||||||
|
@export var max_delta := 2000.0
|
||||||
|
|
||||||
|
@export var delay_mean := 0.7
|
||||||
|
@export var delay_st_dev := 0.1
|
||||||
|
|
||||||
|
@export var counter_decay := 40.0
|
||||||
|
|
||||||
|
@export var pitch_variance := 0.15
|
||||||
|
@export var noise_rate := 0.01
|
||||||
|
@export var noise: Noise
|
||||||
|
|
||||||
|
var _counter := 0.0
|
||||||
|
|
||||||
|
@onready var cooldown: Timer = %Cooldown
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
if World.instance and World.instance.manager:
|
||||||
|
World.instance.manager.grunk_collected.connect(on_grunk_collected)
|
||||||
|
|
||||||
|
|
||||||
|
func on_grunk_collected(delta: float) -> void:
|
||||||
|
delta = min(delta, max_delta)
|
||||||
|
while delta > _counter:
|
||||||
|
delta -= _counter
|
||||||
|
_counter = interval
|
||||||
|
var delay := randfn(delay_mean, delay_st_dev)
|
||||||
|
get_tree().create_timer(delay).timeout.connect(play_random)
|
||||||
|
_counter -= delta
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
_counter = move_toward(_counter, 0.0, counter_decay * delta)
|
||||||
|
|
||||||
|
|
||||||
|
func play_random() -> void:
|
||||||
|
var noise_sample := clampf(
|
||||||
|
2 * noise.get_noise_1d(Engine.get_process_frames() * noise_rate), -1, 1
|
||||||
|
)
|
||||||
|
pitch_scale = 1.0 + (pitch_variance * noise_sample)
|
||||||
|
print_debug("noise: ", noise_sample)
|
||||||
|
play()
|
@ -0,0 +1 @@
|
|||||||
|
uid://dwt66u7ua1to4
|
20
src/player/grunk_collection_sfx/grunk_collection_sfx.tscn
Normal file
20
src/player/grunk_collection_sfx/grunk_collection_sfx.tscn
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://cbtmhu787diev"]
|
||||||
|
|
||||||
|
[ext_resource type="AudioStream" uid="uid://cof6pg6yadsac" path="res://assets/sfx/tools/collect5.wav" id="1_y7it3"]
|
||||||
|
[ext_resource type="Script" uid="uid://dwt66u7ua1to4" path="res://src/player/grunk_collection_sfx/grunk_collection_sfx.gd" id="5_ihwko"]
|
||||||
|
|
||||||
|
[sub_resource type="FastNoiseLite" id="FastNoiseLite_y7it3"]
|
||||||
|
|
||||||
|
[node name="GrunkCollectionSFX" type="AudioStreamPlayer"]
|
||||||
|
stream = ExtResource("1_y7it3")
|
||||||
|
volume_db = -6.0
|
||||||
|
script = ExtResource("5_ihwko")
|
||||||
|
noise_rate = 1.0
|
||||||
|
noise = SubResource("FastNoiseLite_y7it3")
|
||||||
|
|
||||||
|
[node name="Cooldown" type="Timer" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
wait_time = 0.12
|
||||||
|
one_shot = true
|
||||||
|
|
||||||
|
[connection signal="timeout" from="Cooldown" to="." method="trigger"]
|
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=69 format=3 uid="uid://bwe2jdmvinhqd"]
|
[gd_scene load_steps=70 format=3 uid="uid://bwe2jdmvinhqd"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://buwh0g1ga2aka" path="res://src/player/player.gd" id="1_npueo"]
|
[ext_resource type="Script" uid="uid://buwh0g1ga2aka" path="res://src/player/player.gd" id="1_npueo"]
|
||||||
[ext_resource type="Script" uid="uid://cx1yt0drthpw3" path="res://src/player/camera_controller.gd" id="2_veeqv"]
|
[ext_resource type="Script" uid="uid://cx1yt0drthpw3" path="res://src/player/camera_controller.gd" id="2_veeqv"]
|
||||||
@ -39,6 +39,7 @@
|
|||||||
[ext_resource type="Script" uid="uid://b5loa2u6s5l5c" path="res://src/player/rigid_body_physics.gd" id="36_phdu6"]
|
[ext_resource type="Script" uid="uid://b5loa2u6s5l5c" path="res://src/player/rigid_body_physics.gd" id="36_phdu6"]
|
||||||
[ext_resource type="Script" uid="uid://dg55jdoyctdq6" path="res://src/game/tutorial/tutorial_timer.gd" id="38_evlgt"]
|
[ext_resource type="Script" uid="uid://dg55jdoyctdq6" path="res://src/game/tutorial/tutorial_timer.gd" id="38_evlgt"]
|
||||||
[ext_resource type="AudioStream" uid="uid://c01y7jauf4spn" path="res://assets/sfx/tools/tool_switch_v0.wav" id="39_gsylq"]
|
[ext_resource type="AudioStream" uid="uid://c01y7jauf4spn" path="res://assets/sfx/tools/tool_switch_v0.wav" id="39_gsylq"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cbtmhu787diev" path="res://src/player/grunk_collection_sfx/grunk_collection_sfx.tscn" id="40_utg71"]
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_x42xx"]
|
[sub_resource type="Animation" id="Animation_x42xx"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
@ -834,3 +835,5 @@ tutorial_key = &"game/tutorial/progress/move"
|
|||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
stream = ExtResource("39_gsylq")
|
stream = ExtResource("39_gsylq")
|
||||||
pitch_scale = 1.8
|
pitch_scale = 1.8
|
||||||
|
|
||||||
|
[node name="GrunkCollectionSFX" parent="." instance=ExtResource("40_utg71")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user