Grunk collection noise base pitch scales with tank fullness
All checks were successful
linting & formatting / build (push) Successful in 36s

This commit is contained in:
Rob Kelly 2025-08-19 16:30:06 -06:00
parent 878e929fce
commit 7e00f54378
3 changed files with 11 additions and 3 deletions

View File

@ -9,8 +9,8 @@ extends AudioStreamPlayer
@export var counter_decay := 140.0 @export var counter_decay := 140.0
@export var base_pitch := 1.5 @export var base_pitch_curve: Curve
@export var pitch_variance := 0.2 @export var pitch_variance := 0.1618
@export var noise_rate := 1.0 @export var noise_rate := 1.0
@export var noise: Noise @export var noise: Noise
@ -42,5 +42,6 @@ func play_random() -> void:
var noise_sample := clampf( var noise_sample := clampf(
2 * noise.get_noise_1d(Engine.get_process_frames() * noise_rate), -1, 1 2 * noise.get_noise_1d(Engine.get_process_frames() * noise_rate), -1, 1
) )
var base_pitch := base_pitch_curve.sample(World.instance.manager.get_tank_fill_pct())
pitch_scale = base_pitch + (pitch_variance * noise_sample) pitch_scale = base_pitch + (pitch_variance * noise_sample)
play() play()

View File

@ -1,8 +1,13 @@
[gd_scene load_steps=4 format=3 uid="uid://cbtmhu787diev"] [gd_scene load_steps=5 format=3 uid="uid://cbtmhu787diev"]
[ext_resource type="AudioStream" uid="uid://cj6rj8ujl60e3" path="res://assets/sfx/tools/collect2.wav" id="1_y7it3"] [ext_resource type="AudioStream" uid="uid://cj6rj8ujl60e3" path="res://assets/sfx/tools/collect2.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"] [ext_resource type="Script" uid="uid://dwt66u7ua1to4" path="res://src/player/grunk_collection_sfx/grunk_collection_sfx.gd" id="5_ihwko"]
[sub_resource type="Curve" id="Curve_y7it3"]
_limits = [0.0, 2.4, 0.0, 1.0]
_data = [Vector2(0, 1), 0.0, 8.88538, 0, 0, Vector2(0.125, 1.4), 0.0, 0.0, 0, 0, Vector2(0.5, 1.4), 0.0, 0.0, 0, 0, Vector2(1, 2.4), 6.54458, 0.0, 0, 0]
point_count = 4
[sub_resource type="FastNoiseLite" id="FastNoiseLite_y7it3"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_y7it3"]
[node name="GrunkCollectionSFX" type="AudioStreamPlayer"] [node name="GrunkCollectionSFX" type="AudioStreamPlayer"]
@ -11,6 +16,7 @@ volume_db = -4.0
max_polyphony = 3 max_polyphony = 3
bus = &"SFX" bus = &"SFX"
script = ExtResource("5_ihwko") script = ExtResource("5_ihwko")
base_pitch_curve = SubResource("Curve_y7it3")
noise = SubResource("FastNoiseLite_y7it3") noise = SubResource("FastNoiseLite_y7it3")
[node name="Cooldown" type="Timer" parent="."] [node name="Cooldown" type="Timer" parent="."]

View File

@ -837,3 +837,4 @@ stream = ExtResource("39_gsylq")
pitch_scale = 1.8 pitch_scale = 1.8
[node name="GrunkCollectionSFX" parent="." instance=ExtResource("40_utg71")] [node name="GrunkCollectionSFX" parent="." instance=ExtResource("40_utg71")]
interval = 160