Compare commits

...

3 Commits

Author SHA1 Message Date
e1c521f23a Added listener node
All checks were successful
linting & formatting / build (push) Successful in 27s
2025-04-04 15:39:14 -06:00
eb57362199 Added framework for in-game sounds & listeners 2025-04-04 14:40:42 -06:00
333c9c20bb Player sneaking movement mode 2025-04-04 14:22:26 -06:00
22 changed files with 773 additions and 48 deletions

View File

@ -21,13 +21,14 @@ PAUSE_QUIT_MSG,"Quit to desktop?\nUnsaved progress will be lost."
SETTINGS_GAME,Game SETTINGS_GAME,Game
SETTINGS_GAME_HEADING,"Game Configuration" SETTINGS_GAME_HEADING,"Game Configuration"
SETTINGS_GAME_ACCESSIBILITY_HEADING,Accessibility SETTINGS_GAME_ACCESSIBILITY_HEADING,Accessibility
SETTINGS_GAME_CAMERA_HEADING,Camera SETTINGS_GAME_INPUT_HEADING,Input
SETTINGS_SCREEN_SHAKE,"Enable Screen Shake" SETTINGS_SCREEN_SHAKE,"Enable Screen Shake"
SETTINGS_HEAD_BOB,"Enable Head Bob" SETTINGS_HEAD_BOB,"Enable Head Bob"
SETTINGS_SENSITIVITY_X,"Sensitivity, Horizontal" SETTINGS_SENSITIVITY_X,"Sensitivity, Horizontal"
SETTINGS_SENSITIVITY_Y,"Sensitivity, Vertical" SETTINGS_SENSITIVITY_Y,"Sensitivity, Vertical"
SETTINGS_MOUSE_ACCELERATION,"Mouse Acceleration" SETTINGS_MOUSE_ACCELERATION,"Mouse Acceleration"
SETTINGS_INVERT_PITCH,"Invert Pitch" SETTINGS_INVERT_PITCH,"Invert Pitch"
SETTINGS_HOLD_TO_SNEAK,"Hold to Sneak"
SETTINGS_GRAPHICS,Graphics SETTINGS_GRAPHICS,Graphics
SETTINGS_GRAPHICS_HEADING,"Graphics & Display" SETTINGS_GRAPHICS_HEADING,"Graphics & Display"
SETTINGS_GRAPHICS_DISPLAY_HEADING,Display SETTINGS_GRAPHICS_DISPLAY_HEADING,Display

1 keys en
21 SETTINGS_GAME Game
22 SETTINGS_GAME_HEADING Game Configuration
23 SETTINGS_GAME_ACCESSIBILITY_HEADING Accessibility
24 SETTINGS_GAME_CAMERA_HEADING SETTINGS_GAME_INPUT_HEADING Camera Input
25 SETTINGS_SCREEN_SHAKE Enable Screen Shake
26 SETTINGS_HEAD_BOB Enable Head Bob
27 SETTINGS_SENSITIVITY_X Sensitivity, Horizontal
28 SETTINGS_SENSITIVITY_Y Sensitivity, Vertical
29 SETTINGS_MOUSE_ACCELERATION Mouse Acceleration
30 SETTINGS_INVERT_PITCH Invert Pitch
31 SETTINGS_HOLD_TO_SNEAK Hold to Sneak
32 SETTINGS_GRAPHICS Graphics
33 SETTINGS_GRAPHICS_HEADING Graphics & Display
34 SETTINGS_GRAPHICS_DISPLAY_HEADING Display

View File

@ -141,7 +141,7 @@ transform = Transform3D(0.866025, -0.156955, -0.474726, 0.5, 0.271854, 0.82225,
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_bg05n") environment = SubResource("Environment_bg05n")
[node name="WorldFloor" type="StaticBody3D" parent="."] [node name="WorldFloor" type="StaticBody3D" parent="." groups=["PlasticMaterial"]]
[node name="MeshInstance3D" type="MeshInstance3D" parent="WorldFloor"] [node name="MeshInstance3D" type="MeshInstance3D" parent="WorldFloor"]
mesh = SubResource("PlaneMesh_mn2wa") mesh = SubResource("PlaneMesh_mn2wa")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=24 format=3 uid="uid://b5jubpjj3d277"] [gd_scene load_steps=28 format=3 uid="uid://b5jubpjj3d277"]
[ext_resource type="PackedScene" uid="uid://c2omlx4ptrc01" path="res://src/world/gunk_body/gunk_body.tscn" id="1_3u410"] [ext_resource type="PackedScene" uid="uid://c2omlx4ptrc01" path="res://src/world/gunk_body/gunk_body.tscn" id="1_3u410"]
[ext_resource type="Shader" uid="uid://ckxc0ngd37rtk" path="res://src/shaders/gunk.gdshader" id="2_tfbib"] [ext_resource type="Shader" uid="uid://ckxc0ngd37rtk" path="res://src/shaders/gunk.gdshader" id="2_tfbib"]
@ -11,6 +11,7 @@
[ext_resource type="PackedScene" uid="uid://bttust5ohud8e" path="res://src/world/mechanics/relay/gunk_relay.tscn" id="9_d4a3d"] [ext_resource type="PackedScene" uid="uid://bttust5ohud8e" path="res://src/world/mechanics/relay/gunk_relay.tscn" id="9_d4a3d"]
[ext_resource type="PackedScene" uid="uid://dgeg3kkogm71m" path="res://src/world/mechanics/alarm/gunk_alarm.tscn" id="10_l8xa5"] [ext_resource type="PackedScene" uid="uid://dgeg3kkogm71m" path="res://src/world/mechanics/alarm/gunk_alarm.tscn" id="10_l8xa5"]
[ext_resource type="PackedScene" uid="uid://d0j20q65wnqsr" path="res://src/world/mechanics/heart/gunk_heart.tscn" id="11_tfbib"] [ext_resource type="PackedScene" uid="uid://d0j20q65wnqsr" path="res://src/world/mechanics/heart/gunk_heart.tscn" id="11_tfbib"]
[ext_resource type="PackedScene" uid="uid://kctp5erogwcb" path="res://src/world/mechanics/listener/listener.tscn" id="12_e8utx"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgmn0"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgmn0"]
resource_local_to_scene = true resource_local_to_scene = true
@ -164,6 +165,60 @@ shader_parameter/jitter_time_scale = 0.1
shader_parameter/vertex_inflation = 0.0 shader_parameter/vertex_inflation = 0.0
shader_parameter/inflation_pixellation = 10.0 shader_parameter/inflation_pixellation = 10.0
[sub_resource type="ArrayMesh" id="ArrayMesh_r07l4"]
_surfaces = [{
"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3),
"format": 34896613377,
"index_count": 6,
"index_data": PackedByteArray(0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0),
"name": "Plane",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 4,
"vertex_data": PackedByteArray(255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_67o2j"]
_surfaces = [{
"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3),
"attribute_data": PackedByteArray(255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0),
"format": 34896613399,
"index_count": 6,
"index_data": PackedByteArray(0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0),
"material": SubResource("StandardMaterial3D_3u410"),
"name": "Plane",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 4,
"vertex_data": PackedByteArray(255, 255, 0, 0, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 255, 255, 0, 0, 0, 0, 255, 191, 0, 0, 0, 0, 0, 0, 255, 191, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127)
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_r07l4")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_e8utx"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("2_tfbib")
shader_parameter/color_1 = Color(0, 0.03, 0.1, 1)
shader_parameter/color_2 = Color(0, 0.1, 0.3, 1)
shader_parameter/emission_color = Color(0.25, 0.88, 1, 1)
shader_parameter/pixellation = 128.0
shader_parameter/time_pixellation = 30.0
shader_parameter/roughness = 0.15
shader_parameter/specular_contribution = 0.8
shader_parameter/emission_strength = 0.02
shader_parameter/uv_scale = Vector2(4, 4)
shader_parameter/time_scale = 0.2
shader_parameter/edge_bleed = 0.25
shader_parameter/gunk_mask = SubResource("CompressedTexture2D_f342o")
shader_parameter/gunk_noise = SubResource("NoiseTexture3D_iyuyb")
shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_qjnj2")
shader_parameter/jitter_magnitude = 0.0
shader_parameter/jitter_time_scale = 0.1
shader_parameter/vertex_inflation = 0.0
shader_parameter/inflation_pixellation = 10.0
[node name="SignalTest" type="Node3D"] [node name="SignalTest" type="Node3D"]
[node name="TriggerNetWall" type="MeshInstance3D" parent="."] [node name="TriggerNetWall" type="MeshInstance3D" parent="."]
@ -239,6 +294,52 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.3, -1.96701e-08, -0.45)
[node name="GunkAlarm" parent="PulseNetWall/Puzzle" instance=ExtResource("10_l8xa5")] [node name="GunkAlarm" parent="PulseNetWall/Puzzle" instance=ExtResource("10_l8xa5")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.37114e-08, -1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.37114e-08, -1)
[node name="ListenerWall" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 7, 1.5, 0)
mesh = SubResource("ArrayMesh_67o2j")
[node name="GunkBody" parent="ListenerWall" instance=ExtResource("1_3u410")]
mask_dim = 64
source_gunk_material = SubResource("ShaderMaterial_e8utx")
[node name="CollisionShape3D" type="CollisionShape3D" parent="ListenerWall/GunkBody"]
shape = SubResource("ConcavePolygonShape3D_x2vho")
[node name="Puzzle" type="Node3D" parent="ListenerWall"]
[node name="Listener" parent="ListenerWall/Puzzle" instance=ExtResource("12_e8utx")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.37114e-08, 1)
[node name="GunkRelay" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.35, 2.18557e-08, 0.5)
[node name="GunkRelay2" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.7, 4.37115e-09, 0.1)
[node name="GunkRelay3" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9, -1.96701e-08, -0.45)
[node name="GunkRelay4" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.65, -4.15258e-08, -0.95)
[node name="GunkRelay5" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0999994, -5.02681e-08, -1.15)
[node name="GunkRelay6" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.400001, -3.71547e-08, -0.85)
[node name="GunkRelay7" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, -1.5299e-08, -0.35)
[node name="GunkRelay8" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, -2.18557e-09, -0.0500002)
[node name="GunkRelay9" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, -6.55671e-09, -0.15)
[node name="GunkRelay10" parent="ListenerWall/Puzzle" instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, -2.18557e-08, -0.5)
[connection signal="destroyed" from="TriggerNetWall/Puzzle/GunkTrigger" to="TriggerNetWall/Puzzle/GunkRelay" method="trigger"] [connection signal="destroyed" from="TriggerNetWall/Puzzle/GunkTrigger" to="TriggerNetWall/Puzzle/GunkRelay" method="trigger"]
[connection signal="triggered" from="TriggerNetWall/Puzzle/GunkRelay" to="TriggerNetWall/Puzzle/GunkRelay2" method="trigger"] [connection signal="triggered" from="TriggerNetWall/Puzzle/GunkRelay" to="TriggerNetWall/Puzzle/GunkRelay2" method="trigger"]
[connection signal="triggered" from="TriggerNetWall/Puzzle/GunkRelay5" to="TriggerNetWall/Puzzle/GunkRelay2" method="trigger"] [connection signal="triggered" from="TriggerNetWall/Puzzle/GunkRelay5" to="TriggerNetWall/Puzzle/GunkRelay2" method="trigger"]
@ -255,3 +356,22 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.37114e-08, -1)
[connection signal="pulsed" from="PulseNetWall/Puzzle/GunkRelay4" to="PulseNetWall/Puzzle/GunkRelay6" method="pulse"] [connection signal="pulsed" from="PulseNetWall/Puzzle/GunkRelay4" to="PulseNetWall/Puzzle/GunkRelay6" method="pulse"]
[connection signal="pulsed" from="PulseNetWall/Puzzle/GunkRelay5" to="PulseNetWall/Puzzle/GunkAlarm" method="pulse"] [connection signal="pulsed" from="PulseNetWall/Puzzle/GunkRelay5" to="PulseNetWall/Puzzle/GunkAlarm" method="pulse"]
[connection signal="pulsed" from="PulseNetWall/Puzzle/GunkRelay6" to="PulseNetWall/Puzzle/GunkAlarm" method="pulse"] [connection signal="pulsed" from="PulseNetWall/Puzzle/GunkRelay6" to="PulseNetWall/Puzzle/GunkAlarm" method="pulse"]
[connection signal="triggered" from="ListenerWall/Puzzle/Listener" to="ListenerWall/Puzzle/GunkRelay" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay" to="ListenerWall/Puzzle/GunkRelay2" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay" to="ListenerWall/Puzzle/GunkRelay2" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay2" to="ListenerWall/Puzzle/GunkRelay3" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay2" to="ListenerWall/Puzzle/GunkRelay3" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay3" to="ListenerWall/Puzzle/GunkRelay4" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay3" to="ListenerWall/Puzzle/GunkRelay4" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay4" to="ListenerWall/Puzzle/GunkRelay5" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay4" to="ListenerWall/Puzzle/GunkRelay5" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay5" to="ListenerWall/Puzzle/GunkRelay6" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay5" to="ListenerWall/Puzzle/GunkRelay6" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay6" to="ListenerWall/Puzzle/GunkRelay7" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay6" to="ListenerWall/Puzzle/GunkRelay7" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay7" to="ListenerWall/Puzzle/GunkRelay8" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay7" to="ListenerWall/Puzzle/GunkRelay8" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay8" to="ListenerWall/Puzzle/GunkRelay9" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay8" to="ListenerWall/Puzzle/GunkRelay9" method="trigger"]
[connection signal="pulsed" from="ListenerWall/Puzzle/GunkRelay9" to="ListenerWall/Puzzle/GunkRelay10" method="trigger"]
[connection signal="triggered" from="ListenerWall/Puzzle/GunkRelay9" to="ListenerWall/Puzzle/GunkRelay10" method="trigger"]

View File

@ -71,6 +71,7 @@ config/input/mouse_acceleration=30.0
audio/buses/override_bus_layout="user://audio_bus_layout.tres" audio/buses/override_bus_layout="user://audio_bus_layout.tres"
config/accessibility/enable_screen_shake=true config/accessibility/enable_screen_shake=true
config/accessibility/enable_head_bob=true config/accessibility/enable_head_bob=true
config/input/hold_to_sneak=true
[global_group] [global_group]
@ -182,6 +183,7 @@ locale/translations=PackedStringArray("res://assets/text/text.en.translation")
3d_physics/layer_2="Interactive" 3d_physics/layer_2="Interactive"
3d_physics/layer_3="Sprayable" 3d_physics/layer_3="Sprayable"
3d_physics/layer_4="Player" 3d_physics/layer_4="Player"
3d_physics/layer_5="GameSounds"
[rendering] [rendering]

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=20 format=3 uid="uid://xlt78xc1tmkl"] [gd_scene load_steps=22 format=3 uid="uid://xlt78xc1tmkl"]
[ext_resource type="Texture2D" uid="uid://cgwgmxwjgwbwr" path="res://assets/particles/splatter_2.png" id="1_5xu2x"] [ext_resource type="Texture2D" uid="uid://cgwgmxwjgwbwr" path="res://assets/particles/splatter_2.png" id="1_5xu2x"]
[ext_resource type="Texture2D" uid="uid://bhoai6xv53tqm" path="res://assets/particles/splatter_1.png" id="2_bt63p"] [ext_resource type="Texture2D" uid="uid://bhoai6xv53tqm" path="res://assets/particles/splatter_1.png" id="2_bt63p"]
[ext_resource type="AudioStream" uid="uid://di0j2xhgfc78s" path="res://assets/sfx/grunk/splat1.wav" id="3_t00bd"] [ext_resource type="AudioStream" uid="uid://di0j2xhgfc78s" path="res://assets/sfx/grunk/splat1.wav" id="3_t00bd"]
[ext_resource type="AudioStream" uid="uid://d1w5gfmjj7tjk" path="res://assets/sfx/grunk/splat2.wav" id="4_2iem1"] [ext_resource type="AudioStream" uid="uid://d1w5gfmjj7tjk" path="res://assets/sfx/grunk/splat2.wav" id="4_2iem1"]
[ext_resource type="Script" uid="uid://c5o1d2shq2qig" path="res://src/world/game_sound/game_sound_emitter.gd" id="5_2iem1"]
[sub_resource type="Gradient" id="Gradient_5xu2x"] [sub_resource type="Gradient" id="Gradient_5xu2x"]
offsets = PackedFloat32Array(0, 0.291304, 0.526087, 1) offsets = PackedFloat32Array(0, 0.291304, 0.526087, 1)
@ -99,6 +100,9 @@ streams_count = 2
stream_0/stream = ExtResource("3_t00bd") stream_0/stream = ExtResource("3_t00bd")
stream_1/stream = ExtResource("4_2iem1") stream_1/stream = ExtResource("4_2iem1")
[sub_resource type="SphereShape3D" id="SphereShape3D_6adkd"]
radius = 2.0
[node name="GrunkSplatter" type="GPUParticles3D"] [node name="GrunkSplatter" type="GPUParticles3D"]
sorting_offset = 9.0 sorting_offset = 9.0
emitting = false emitting = false
@ -133,7 +137,17 @@ unit_size = 6.0
autoplay = true autoplay = true
bus = &"SFX" bus = &"SFX"
[node name="SplatterSoundEmitter" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 16
script = ExtResource("5_2iem1")
metadata/_custom_type_script = "uid://c5o1d2shq2qig"
[node name="CollisionShape3D" type="CollisionShape3D" parent="SplatterSoundEmitter"]
shape = SubResource("SphereShape3D_6adkd")
[connection signal="ready" from="." to="SplatterSFX" method="play"] [connection signal="ready" from="." to="SplatterSFX" method="play"]
[connection signal="ready" from="." to="SplatterSoundEmitter" method="emit_sound_here"]
[connection signal="ready" from="." to="." method="set_emitting" binds= [true]] [connection signal="ready" from="." to="." method="set_emitting" binds= [true]]
[connection signal="ready" from="." to="SubSplatter" method="set_emitting" binds= [true]] [connection signal="ready" from="." to="SubSplatter" method="set_emitting" binds= [true]]
[connection signal="timeout" from="FreeTimer" to="." method="queue_free"] [connection signal="timeout" from="FreeTimer" to="." method="queue_free"]

View File

@ -6,6 +6,8 @@ class_name SpraySFX extends AudioStreamPlayer3D
var _active_this_frame := false var _active_this_frame := false
@onready var spray_game_sound_emitter: GameSoundEmitter = %SprayGameSoundEmitter
func activate() -> void: func activate() -> void:
_active_this_frame = true _active_this_frame = true
@ -23,6 +25,7 @@ func _process(_delta: float) -> void:
if _active_this_frame: if _active_this_frame:
if not playing: if not playing:
play() play()
spray_game_sound_emitter.emit_sound_here()
else: else:
stop() stop()

View File

@ -1,11 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://btq11kil0jcql"] [gd_scene load_steps=5 format=3 uid="uid://btq11kil0jcql"]
[ext_resource type="AudioStream" uid="uid://b5ik76jgl8mex" path="res://assets/sfx/tools/spray.wav" id="1_575yt"] [ext_resource type="AudioStream" uid="uid://b5ik76jgl8mex" path="res://assets/sfx/tools/spray.wav" id="1_575yt"]
[ext_resource type="Script" uid="uid://bhvkgqpm7sglw" path="res://src/equipment/beam_sfx/spray_sfx.gd" id="2_yajv7"] [ext_resource type="Script" uid="uid://bhvkgqpm7sglw" path="res://src/equipment/beam_sfx/spray_sfx.gd" id="2_yajv7"]
[ext_resource type="Script" uid="uid://c5o1d2shq2qig" path="res://src/world/game_sound/game_sound_emitter.gd" id="3_rikqc"]
[sub_resource type="SphereShape3D" id="SphereShape3D_yaakk"]
radius = 2.0
[node name="SpraySFX" type="AudioStreamPlayer3D"] [node name="SpraySFX" type="AudioStreamPlayer3D"]
stream = ExtResource("1_575yt") stream = ExtResource("1_575yt")
attenuation_model = 1 attenuation_model = 1
volume_db = -12.0
unit_size = 2.0 unit_size = 2.0
bus = &"SFX" bus = &"SFX"
script = ExtResource("2_yajv7") script = ExtResource("2_yajv7")
[node name="SprayGameSoundEmitter" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 0
collision_mask = 16
script = ExtResource("3_rikqc")
metadata/_custom_type_script = "uid://c5o1d2shq2qig"
[node name="CollisionShape3D" type="CollisionShape3D" parent="SprayGameSoundEmitter"]
shape = SubResource("SphereShape3D_yaakk")

View File

@ -10,6 +10,7 @@ var mouse_sensitivity_x: float
var mouse_sensitivity_y: float var mouse_sensitivity_y: float
var mouse_acceleration: float var mouse_acceleration: float
var invert_pitch: bool var invert_pitch: bool
var hold_to_sneak: bool
var enable_screen_shake: bool var enable_screen_shake: bool
var enable_head_bob: bool var enable_head_bob: bool
@ -31,6 +32,7 @@ func _read_settings() -> void:
mouse_sensitivity_y = ProjectSettings.get_setting("game/config/input/mouse_sensitivity_y") mouse_sensitivity_y = ProjectSettings.get_setting("game/config/input/mouse_sensitivity_y")
mouse_acceleration = ProjectSettings.get_setting("game/config/input/mouse_acceleration") mouse_acceleration = ProjectSettings.get_setting("game/config/input/mouse_acceleration")
invert_pitch = ProjectSettings.get_setting("game/config/input/invert_pitch") invert_pitch = ProjectSettings.get_setting("game/config/input/invert_pitch")
hold_to_sneak = ProjectSettings.get_setting("game/config/input/hold_to_sneak")
enable_screen_shake = ProjectSettings.get_setting( enable_screen_shake = ProjectSettings.get_setting(
"game/config/accessibility/enable_screen_shake" "game/config/accessibility/enable_screen_shake"

View File

@ -12,9 +12,13 @@ var _on_right_foot := false
@onready var right_foot: FootController = %RightFoot @onready var right_foot: FootController = %RightFoot
@onready var foot_cast: RayCast3D = %FootCast @onready var foot_cast: RayCast3D = %FootCast
@onready var footstep_game_sound_emitter: GameSoundEmitter = %FootstepGameSoundEmitter
func play_footstep() -> void: func play_footstep() -> void:
if player.sneaking:
return
var foot := right_foot if _on_right_foot else left_foot var foot := right_foot if _on_right_foot else left_foot
var relative_speed := player.velocity.length() - MUTE_VELOCITY var relative_speed := player.velocity.length() - MUTE_VELOCITY
@ -25,6 +29,7 @@ func play_footstep() -> void:
if sfx: if sfx:
sfx.volume_db = BASE_VOLUME + relative_speed * VELOCITY_FACTOR sfx.volume_db = BASE_VOLUME + relative_speed * VELOCITY_FACTOR
sfx.play() sfx.play()
footstep_game_sound_emitter.emit_sound_here()
_on_right_foot = not _on_right_foot _on_right_foot = not _on_right_foot

View File

@ -1,17 +1,29 @@
class_name Player extends CharacterBody3D class_name Player extends CharacterBody3D
const FOCUS_SPEED := 30.0 #region Exported Properties
const RUN_SPEED := 80.0
const SPRINT_SPEED := 160.0
const AIR_SPEED := 10.0
const JUMP_FORCE := 4.5 @export_category("Movement")
@export_group("Speed")
@export var run_speed := 80.0
@export var sprint_speed := 160.0
@export var sneak_speed := 40.0
@export var focus_speed := 25.0
@export var air_speed_factor := 0.1
const GROUND_FRICTION := 0.3 @export_group("Jump")
const AIR_FRICTION := 0.03 @export var jump_force := 4.0
@export_group("Friction")
@export var ground_friction := 0.3
@export var air_friction := 0.03
@export_category("Inventory")
@export var inventory: Dictionary[Item, int] = {} @export var inventory: Dictionary[Item, int] = {}
#endregion
#region Member Variables
var gravity: Vector3 = ( var gravity: Vector3 = (
ProjectSettings.get_setting("physics/3d/default_gravity") ProjectSettings.get_setting("physics/3d/default_gravity")
* ProjectSettings.get_setting("physics/3d/default_gravity_vector") * ProjectSettings.get_setting("physics/3d/default_gravity_vector")
@ -19,6 +31,9 @@ var gravity: Vector3 = (
var selected_interactive: Interactive var selected_interactive: Interactive
var firing := false var firing := false
var sneaking := false
var _was_on_floor := false
@onready var hud: PlayerHUD = %PlayerHUD @onready var hud: PlayerHUD = %PlayerHUD
@ -31,28 +46,45 @@ var firing := false
@onready var wide_spray: WideSpray = %WideSpray @onready var wide_spray: WideSpray = %WideSpray
@onready var toothbrush: Tool = %Toothbrush @onready var toothbrush: Tool = %Toothbrush
@onready var crouch_head_area: Area3D = %CrouchHeadArea
@onready var crouch_animation: AnimationPlayer = %CrouchAnimation
@onready var jump_game_sound_emitter: GameSoundEmitter = %JumpGameSoundEmitter
#endregion
## Global static access to player singleton ## Global static access to player singleton
static var instance: Player static var instance: Player
#region _ready
func _ready() -> void: func _ready() -> void:
instance = self instance = self
#endregion
#region Public Methods
func get_speed() -> float: func get_speed() -> float:
if is_on_floor(): var speed := run_speed
if firing:
return FOCUS_SPEED
if Input.is_action_pressed("sprint"): if Input.is_action_pressed("sprint"):
return SPRINT_SPEED speed = sprint_speed
return RUN_SPEED if sneaking:
return AIR_SPEED speed = sneak_speed
if firing:
speed = focus_speed
if not is_on_floor():
speed *= air_speed_factor
return speed
func get_friction() -> float: func get_friction() -> float:
if is_on_floor(): if is_on_floor():
return GROUND_FRICTION return ground_friction
return AIR_FRICTION return air_friction
func get_tool() -> Tool: func get_tool() -> Tool:
@ -71,6 +103,34 @@ func remove_item(item: Item, amount: int = 1) -> void:
inventory.erase(item) inventory.erase(item)
func crouch() -> void:
if not sneaking and not crouch_animation.is_playing():
crouch_animation.play("crouch")
sneaking = true
func uncrouch() -> void:
if (
sneaking
and not crouch_animation.is_playing()
and not crouch_head_area.has_overlapping_bodies()
):
crouch_animation.play_backwards("crouch")
sneaking = false
func toggle_crouch() -> void:
if sneaking:
uncrouch()
else:
crouch()
#endregion
#region _physics_process
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
# Will be null if no valid interactor is selected. # Will be null if no valid interactor is selected.
var interactive: Interactive = interact_ray.get_collider() as Interactive var interactive: Interactive = interact_ray.get_collider() as Interactive
@ -105,8 +165,22 @@ func _physics_process(delta: float) -> void:
if Input.is_action_just_pressed("switch_mode"): if Input.is_action_just_pressed("switch_mode"):
get_tool().switch_mode() get_tool().switch_mode()
# Two sneaking modes -- hold and toggle
if Game.settings.hold_to_sneak:
if Input.is_action_pressed("sneak"):
crouch()
else:
uncrouch()
else:
if Input.is_action_just_pressed("sneak"):
toggle_crouch()
if is_on_floor():
if not _was_on_floor and not sneaking:
# just landed
jump_game_sound_emitter.emit_sound_here()
else:
# Gravity # Gravity
if not is_on_floor():
velocity += gravity * delta velocity += gravity * delta
# Input movement # Input movement
@ -117,11 +191,15 @@ func _physics_process(delta: float) -> void:
velocity.x += movement.x velocity.x += movement.x
velocity.z += movement.z velocity.z += movement.z
if Input.is_action_just_pressed("jump") and is_on_floor(): if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = JUMP_FORCE velocity.y = jump_force
# Friction # Friction
var friction := get_friction() var friction := get_friction()
velocity.x = lerpf(velocity.x, 0, friction) velocity.x = lerpf(velocity.x, 0, friction)
velocity.z = lerpf(velocity.z, 0, friction) velocity.z = lerpf(velocity.z, 0, friction)
_was_on_floor = is_on_floor()
move_and_slide() move_and_slide()
#endregion

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=49 format=3 uid="uid://bwe2jdmvinhqd"] [gd_scene load_steps=57 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"]
@ -30,6 +30,7 @@
[ext_resource type="AudioStream" uid="uid://div20rlq8ync5" path="res://assets/sfx/footsteps/plastic/plastic1.wav" id="28_dpt0q"] [ext_resource type="AudioStream" uid="uid://div20rlq8ync5" path="res://assets/sfx/footsteps/plastic/plastic1.wav" id="28_dpt0q"]
[ext_resource type="AudioStream" uid="uid://djucfo3l7x7px" path="res://assets/sfx/footsteps/plastic/plastic3.wav" id="29_wcxbk"] [ext_resource type="AudioStream" uid="uid://djucfo3l7x7px" path="res://assets/sfx/footsteps/plastic/plastic3.wav" id="29_wcxbk"]
[ext_resource type="AudioStream" uid="uid://ck86vhmbg3xnj" path="res://assets/sfx/footsteps/plastic/plastic5.wav" id="30_p6grl"] [ext_resource type="AudioStream" uid="uid://ck86vhmbg3xnj" path="res://assets/sfx/footsteps/plastic/plastic5.wav" id="30_p6grl"]
[ext_resource type="Script" uid="uid://c5o1d2shq2qig" path="res://src/world/game_sound/game_sound_emitter.gd" id="31_wcxbk"]
[sub_resource type="Animation" id="Animation_x42xx"] [sub_resource type="Animation" id="Animation_x42xx"]
length = 0.001 length = 0.001
@ -151,7 +152,6 @@ animation = &"RESET"
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_8ydov"] [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_8ydov"]
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_ylhto"] [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_ylhto"]
graph_offset = Vector2(-33.7273, -38.6364)
nodes/blend/node = SubResource("AnimationNodeBlend2_o822w") nodes/blend/node = SubResource("AnimationNodeBlend2_o822w")
nodes/blend/position = Vector2(779, 166) nodes/blend/position = Vector2(779, 166)
nodes/bob_anim/node = SubResource("AnimationNodeAnimation_x42xx") nodes/bob_anim/node = SubResource("AnimationNodeAnimation_x42xx")
@ -171,6 +171,10 @@ node_connections = [&"blend", 0, &"still_anim", &"blend", 1, &"bob_anim", &"outp
radius = 0.4 radius = 0.4
height = 1.9 height = 1.9
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dpt0q"]
radius = 0.4
height = 1.2
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_8ydov"] [sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_8ydov"]
random_pitch = 1.1 random_pitch = 1.1
streams_count = 6 streams_count = 6
@ -222,43 +226,247 @@ stream_0/stream = ExtResource("28_dpt0q")
stream_1/stream = ExtResource("29_wcxbk") stream_1/stream = ExtResource("29_wcxbk")
stream_2/stream = ExtResource("30_p6grl") stream_2/stream = ExtResource("30_p6grl")
[sub_resource type="SphereShape3D" id="SphereShape3D_wcxbk"]
radius = 4.0
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_wcxbk"]
radius = 0.4
height = 1.8
[sub_resource type="Animation" id="Animation_dpt0q"]
resource_name = "crouch"
length = 0.2
step = 0.01
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CameraPosition:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0, 0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0, 0.2)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CameraPosition:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(0.5, -0.1, 0, 0.1, 0, -0.2, -0.2, 0, 0.1, 0),
"times": PackedFloat32Array(0, 0.2)
}
tracks/2/type = "bezier"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("CameraPosition:position:z")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0, 0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0, 0.2)
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("CameraPosition:rotation:x")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0, 0, 0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0, 0, -0.1, 0, 0.1, 0, 0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0, 0.1, 0.2)
}
tracks/4/type = "bezier"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("CameraPosition:rotation:y")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"handle_modes": PackedInt32Array(0, 0, 0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0, 0, -0.1, 0, 0.1, 0, 0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0, 0.1, 0.2)
}
tracks/5/type = "bezier"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("CameraPosition:rotation:z")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"handle_modes": PackedInt32Array(0, 0, 0),
"points": PackedFloat32Array(0, -0.1, 0, 0.01, 0, -0.02, -0.01, 0, 0.01, 0, 0, -0.01, 0, 0.1, 0),
"times": PackedFloat32Array(0, 0.1, 0.2)
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("StandingCollider:disabled")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.01),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("CrouchingCollider:disabled")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.01),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
[sub_resource type="Animation" id="Animation_wcxbk"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CameraPosition:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CameraPosition:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0.5, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0)
}
tracks/2/type = "bezier"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("CameraPosition:position:z")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0)
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("CameraPosition:rotation:x")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0)
}
tracks/4/type = "bezier"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("CameraPosition:rotation:y")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0)
}
tracks/5/type = "bezier"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("CameraPosition:rotation:z")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.1, 0, 0.1, 0),
"times": PackedFloat32Array(0)
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("StandingCollider:disabled")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("CrouchingCollider:disabled")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_wcxbk"]
_data = {
&"RESET": SubResource("Animation_wcxbk"),
&"crouch": SubResource("Animation_dpt0q")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_p6grl"]
radius = 3.0
[node name="Player" type="CharacterBody3D"] [node name="Player" type="CharacterBody3D"]
collision_layer = 9 collision_layer = 8
script = ExtResource("1_npueo") script = ExtResource("1_npueo")
[node name="CameraPivot" type="Node3D" parent="."] [node name="CameraPosition" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
[node name="CameraPivot" type="Node3D" parent="CameraPosition"]
unique_name_in_owner = true
script = ExtResource("2_veeqv") script = ExtResource("2_veeqv")
[node name="ToolMount" type="Node3D" parent="CameraPivot" node_paths=PackedStringArray("initial_tool")] [node name="ToolMount" type="Node3D" parent="CameraPosition/CameraPivot" node_paths=PackedStringArray("initial_tool")]
unique_name_in_owner = true unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, -0.1, -0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, -0.1, -0.1)
script = ExtResource("3_jiejy") script = ExtResource("3_jiejy")
initial_tool = NodePath("PointSpray") initial_tool = NodePath("PointSpray")
[node name="PointSpray" parent="CameraPivot/ToolMount" instance=ExtResource("3_6wgkm")] [node name="PointSpray" parent="CameraPosition/CameraPivot/ToolMount" instance=ExtResource("3_6wgkm")]
unique_name_in_owner = true unique_name_in_owner = true
[node name="WideSpray" parent="CameraPivot/ToolMount" instance=ExtResource("3_ibq07")] [node name="WideSpray" parent="CameraPosition/CameraPivot/ToolMount" instance=ExtResource("3_ibq07")]
unique_name_in_owner = true unique_name_in_owner = true
visible = false visible = false
[node name="Toothbrush" parent="CameraPivot/ToolMount" instance=ExtResource("6_o822w")] [node name="Toothbrush" parent="CameraPosition/CameraPivot/ToolMount" instance=ExtResource("6_o822w")]
unique_name_in_owner = true unique_name_in_owner = true
visible = false visible = false
[node name="CameraPosition" type="Node3D" parent="CameraPivot"] [node name="Camera3D" type="Camera3D" parent="CameraPosition/CameraPivot"]
[node name="Camera3D" type="Camera3D" parent="CameraPivot/CameraPosition"]
current = true current = true
[node name="InteractRay" type="RayCast3D" parent="CameraPivot/CameraPosition/Camera3D"] [node name="InteractRay" type="RayCast3D" parent="CameraPosition/CameraPivot/Camera3D"]
unique_name_in_owner = true unique_name_in_owner = true
target_position = Vector3(0, 0, -1.5) target_position = Vector3(0, 0, -1.5)
collision_mask = 2 collision_mask = 2
[node name="FarLight" type="OmniLight3D" parent="CameraPivot/CameraPosition/Camera3D"] [node name="FarLight" type="OmniLight3D" parent="CameraPosition/CameraPivot/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1)
light_energy = 0.05 light_energy = 0.05
light_specular = 0.01 light_specular = 0.01
@ -266,18 +474,18 @@ light_cull_mask = 4294967293
omni_range = 50.0 omni_range = 50.0
omni_attenuation = 0.0 omni_attenuation = 0.0
[node name="NearLight" type="OmniLight3D" parent="CameraPivot/CameraPosition/Camera3D"] [node name="NearLight" type="OmniLight3D" parent="CameraPosition/CameraPivot/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1)
light_specular = 0.01 light_specular = 0.01
light_cull_mask = 4294967293 light_cull_mask = 4294967293
omni_range = 2.0 omni_range = 2.0
[node name="HeadbobAnimation" type="AnimationPlayer" parent="CameraPivot/CameraPosition/Camera3D"] [node name="HeadbobAnimation" type="AnimationPlayer" parent="CameraPosition/CameraPivot/Camera3D"]
libraries = { libraries = {
&"": SubResource("AnimationLibrary_l271a") &"": SubResource("AnimationLibrary_l271a")
} }
[node name="HeadbobController" type="AnimationTree" parent="CameraPivot/CameraPosition/Camera3D/HeadbobAnimation"] [node name="HeadbobController" type="AnimationTree" parent="CameraPosition/CameraPivot/Camera3D/HeadbobAnimation"]
unique_name_in_owner = true unique_name_in_owner = true
root_node = NodePath("%HeadbobController/../..") root_node = NodePath("%HeadbobController/../..")
tree_root = SubResource("AnimationNodeBlendTree_ylhto") tree_root = SubResource("AnimationNodeBlendTree_ylhto")
@ -287,10 +495,15 @@ parameters/sfx_add/add_amount = 1.0
parameters/timescale/scale = false parameters/timescale/scale = false
script = ExtResource("7_x42xx") script = ExtResource("7_x42xx")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] [node name="StandingCollider" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0)
shape = SubResource("CapsuleShape3D_s7f0r") shape = SubResource("CapsuleShape3D_s7f0r")
[node name="CrouchingCollider" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.4, 0)
shape = SubResource("CapsuleShape3D_dpt0q")
disabled = true
[node name="PlayerHUD" parent="." instance=ExtResource("5_jvafu")] [node name="PlayerHUD" parent="." instance=ExtResource("5_jvafu")]
unique_name_in_owner = true unique_name_in_owner = true
@ -343,3 +556,37 @@ bus = &"SFX"
[node name="FootCast" type="RayCast3D" parent="FootstepController"] [node name="FootCast" type="RayCast3D" parent="FootstepController"]
unique_name_in_owner = true unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0518835, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0518835, 0)
[node name="FootstepGameSoundEmitter" type="Area3D" parent="FootstepController"]
unique_name_in_owner = true
collision_layer = 0
collision_mask = 16
script = ExtResource("31_wcxbk")
metadata/_custom_type_script = "uid://c5o1d2shq2qig"
[node name="CollisionShape3D" type="CollisionShape3D" parent="FootstepController/FootstepGameSoundEmitter"]
shape = SubResource("SphereShape3D_wcxbk")
[node name="CrouchHeadArea" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="CrouchHeadArea"]
shape = SubResource("CapsuleShape3D_wcxbk")
[node name="CrouchAnimation" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_wcxbk")
}
[node name="JumpGameSoundEmitter" type="Area3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
collision_layer = 0
collision_mask = 16
script = ExtResource("31_wcxbk")
metadata/_custom_type_script = "uid://c5o1d2shq2qig"
[node name="CollisionShape3D" type="CollisionShape3D" parent="JumpGameSoundEmitter"]
shape = SubResource("SphereShape3D_p6grl")

View File

@ -3,12 +3,14 @@ extends Node3D
@onready var animation: AnimationPlayer = $AnimationPlayer @onready var animation: AnimationPlayer = $AnimationPlayer
@onready var dust_animation: AnimationPlayer = %DustAnimation @onready var dust_animation: AnimationPlayer = %DustAnimation
@onready var open_sfx: AudioStreamPlayer3D = %OpenSFX @onready var open_sfx: AudioStreamPlayer3D = %OpenSFX
@onready var bulkhead_game_sound_emitter: GameSoundEmitter = %BulkheadGameSoundEmitter
func open() -> void: func open() -> void:
animation.play("open") animation.play("open")
dust_animation.play("spray") dust_animation.play("spray")
open_sfx.play() open_sfx.play()
bulkhead_game_sound_emitter.emit_sound_here()
func close() -> void: func close() -> void:

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=4 uid="uid://cubwniraol1qn"] [gd_scene load_steps=21 format=4 uid="uid://cubwniraol1qn"]
[ext_resource type="PackedScene" uid="uid://bopvgd18a1dl0" path="res://assets/props/bulkhead/bulkhead.gltf" id="1_77udb"] [ext_resource type="PackedScene" uid="uid://bopvgd18a1dl0" path="res://assets/props/bulkhead/bulkhead.gltf" id="1_77udb"]
[ext_resource type="Material" uid="uid://dim1g2sr3axr5" path="res://assets/props/bulkhead/bulkhead_frame.material" id="2_88qrs"] [ext_resource type="Material" uid="uid://dim1g2sr3axr5" path="res://assets/props/bulkhead/bulkhead_frame.material" id="2_88qrs"]
@ -7,6 +7,7 @@
[ext_resource type="Material" uid="uid://ba5iycnw36138" path="res://assets/props/bulkhead/bulkhead_door.material" id="3_w7oba"] [ext_resource type="Material" uid="uid://ba5iycnw36138" path="res://assets/props/bulkhead/bulkhead_door.material" id="3_w7oba"]
[ext_resource type="AudioStream" uid="uid://6mm0npep4ul1" path="res://assets/sfx/mechanical_door.wav" id="5_4jho1"] [ext_resource type="AudioStream" uid="uid://6mm0npep4ul1" path="res://assets/sfx/mechanical_door.wav" id="5_4jho1"]
[ext_resource type="AudioStream" uid="uid://dkdw7viq1nqte" path="res://assets/sfx/air_hiss.wav" id="7_4jho1"] [ext_resource type="AudioStream" uid="uid://dkdw7viq1nqte" path="res://assets/sfx/air_hiss.wav" id="7_4jho1"]
[ext_resource type="Script" uid="uid://c5o1d2shq2qig" path="res://src/world/game_sound/game_sound_emitter.gd" id="8_bso71"]
[sub_resource type="ArrayMesh" id="ArrayMesh_hx0vd"] [sub_resource type="ArrayMesh" id="ArrayMesh_hx0vd"]
_surfaces = [{ _surfaces = [{
@ -313,6 +314,9 @@ _data = {
&"spray": SubResource("Animation_88qrs") &"spray": SubResource("Animation_88qrs")
} }
[sub_resource type="SphereShape3D" id="SphereShape3D_jo25b"]
radius = 4.0
[node name="Bulkhead" instance=ExtResource("1_77udb")] [node name="Bulkhead" instance=ExtResource("1_77udb")]
script = ExtResource("2_hknvo") script = ExtResource("2_hknvo")
@ -386,3 +390,14 @@ libraries = {
[node name="DustSFX" type="AudioStreamPlayer3D" parent="Dust" index="5"] [node name="DustSFX" type="AudioStreamPlayer3D" parent="Dust" index="5"]
stream = ExtResource("7_4jho1") stream = ExtResource("7_4jho1")
volume_db = -24.0 volume_db = -24.0
[node name="BulkheadGameSoundEmitter" type="Area3D" parent="." index="6"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
collision_layer = 0
collision_mask = 16
script = ExtResource("8_bso71")
metadata/_custom_type_script = "uid://c5o1d2shq2qig"
[node name="CollisionShape3D" type="CollisionShape3D" parent="BulkheadGameSoundEmitter" index="0"]
shape = SubResource("SphereShape3D_jo25b")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=30 format=4 uid="uid://b6eg8t04rkh0c"] [gd_scene load_steps=32 format=4 uid="uid://b6eg8t04rkh0c"]
[ext_resource type="Script" uid="uid://bkmn5m47mt1gh" path="res://src/props/wall_switch/wall_switch.gd" id="2_kfvqd"] [ext_resource type="Script" uid="uid://bkmn5m47mt1gh" path="res://src/props/wall_switch/wall_switch.gd" id="2_kfvqd"]
[ext_resource type="Texture2D" uid="uid://1wjcyqynwlb6" path="res://assets/props/wall_switch/wall_switch_C.png" id="2_vufqs"] [ext_resource type="Texture2D" uid="uid://1wjcyqynwlb6" path="res://assets/props/wall_switch/wall_switch_C.png" id="2_vufqs"]
@ -12,6 +12,7 @@
[ext_resource type="Script" uid="uid://deg5xd87cy8rg" path="res://src/props/interactive.gd" id="10_qw6jt"] [ext_resource type="Script" uid="uid://deg5xd87cy8rg" path="res://src/props/interactive.gd" id="10_qw6jt"]
[ext_resource type="AudioStream" uid="uid://bgayfws34lg7q" path="res://assets/sfx/click_electronic_04.wav" id="11_7shuc"] [ext_resource type="AudioStream" uid="uid://bgayfws34lg7q" path="res://assets/sfx/click_electronic_04.wav" id="11_7shuc"]
[ext_resource type="AudioStream" uid="uid://cnje66wrijwxw" path="res://assets/sfx/wall_switch.wav" id="12_2qpft"] [ext_resource type="AudioStream" uid="uid://cnje66wrijwxw" path="res://assets/sfx/wall_switch.wav" id="12_2qpft"]
[ext_resource type="Script" uid="uid://c5o1d2shq2qig" path="res://src/world/game_sound/game_sound_emitter.gd" id="13_eim2y"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jtkkw"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jtkkw"]
resource_local_to_scene = true resource_local_to_scene = true
@ -248,6 +249,9 @@ _data = {
[sub_resource type="BoxShape3D" id="BoxShape3D_6maql"] [sub_resource type="BoxShape3D" id="BoxShape3D_6maql"]
size = Vector3(0.475, 0.65, 0.2) size = Vector3(0.475, 0.65, 0.2)
[sub_resource type="SphereShape3D" id="SphereShape3D_mxsyy"]
radius = 3.0
[node name="WallSwitch" instance=ExtResource("2_whafo")] [node name="WallSwitch" instance=ExtResource("2_whafo")]
script = ExtResource("2_kfvqd") script = ExtResource("2_kfvqd")
enabled = true enabled = true
@ -313,7 +317,17 @@ unique_name_in_owner = true
wait_time = 2.8 wait_time = 2.8
one_shot = true one_shot = true
[node name="WallSwitchGameSoundEmitter" type="Area3D" parent="." index="7"]
collision_layer = 0
collision_mask = 16
script = ExtResource("13_eim2y")
metadata/_custom_type_script = "uid://c5o1d2shq2qig"
[node name="CollisionShape3D" type="CollisionShape3D" parent="WallSwitchGameSoundEmitter" index="0"]
shape = SubResource("SphereShape3D_mxsyy")
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_animation_finished"] [connection signal="animation_finished" from="AnimationPlayer" to="." method="_animation_finished"]
[connection signal="clear_total_updated" from="GunkBody" to="." method="_on_gunk_body_clear_total_updated"] [connection signal="clear_total_updated" from="GunkBody" to="." method="_on_gunk_body_clear_total_updated"]
[connection signal="activated" from="Interactive" to="." method="_activate"] [connection signal="activated" from="Interactive" to="." method="_activate"]
[connection signal="timeout" from="ActionDelay" to="." method="_on_action_delay_timeout"] [connection signal="timeout" from="ActionDelay" to="." method="_on_action_delay_timeout"]
[connection signal="timeout" from="ActionDelay" to="WallSwitchGameSoundEmitter" method="emit_sound_here"]

View File

@ -92,15 +92,15 @@ text = "SETTINGS_HEAD_BOB"
[node name="TextCheckbox" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/HeadBob/PanelContainer/MarginContainer" index="0"] [node name="TextCheckbox" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/HeadBob/PanelContainer/MarginContainer" index="0"]
physics_interpolation_mode = 0 physics_interpolation_mode = 0
[node name="CameraHeading" type="HBoxContainer" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList"] [node name="InputHeading" type="HBoxContainer" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList"]
layout_mode = 2 layout_mode = 2
[node name="Label" type="Label" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/CameraHeading"] [node name="Label" type="Label" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/InputHeading"]
layout_mode = 2 layout_mode = 2
theme_type_variation = &"HeaderMedium" theme_type_variation = &"HeaderMedium"
text = "SETTINGS_GAME_CAMERA_HEADING" text = "SETTINGS_GAME_INPUT_HEADING"
[node name="HSeparator" type="HSeparator" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/CameraHeading"] [node name="HSeparator" type="HSeparator" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/InputHeading"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
@ -148,6 +148,16 @@ text = "SETTINGS_INVERT_PITCH"
[node name="TextCheckbox" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/InvertPitch/PanelContainer/MarginContainer" index="0"] [node name="TextCheckbox" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/InvertPitch/PanelContainer/MarginContainer" index="0"]
physics_interpolation_mode = 0 physics_interpolation_mode = 0
[node name="HoldToSneak" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList" groups=["Settings"] instance=ExtResource("2_f274v")]
layout_mode = 2
key = &"game/config/input/hold_to_sneak"
[node name="SettingLabel" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/HoldToSneak" index="1"]
text = "SETTINGS_HOLD_TO_SNEAK"
[node name="TextCheckbox" parent="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/HoldToSneak/PanelContainer/MarginContainer" index="0"]
physics_interpolation_mode = 0
[node name="SETTINGS_GRAPHICS" type="MarginContainer" parent="TabContainer"] [node name="SETTINGS_GRAPHICS" type="MarginContainer" parent="TabContainer"]
visible = false visible = false
layout_mode = 2 layout_mode = 2
@ -332,5 +342,6 @@ text = "UI_ACCEPT"
[editable path="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/SensitivityY"] [editable path="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/SensitivityY"]
[editable path="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/MouseAcceleration"] [editable path="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/MouseAcceleration"]
[editable path="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/InvertPitch"] [editable path="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/InvertPitch"]
[editable path="TabContainer/SETTINGS_GAME/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/HoldToSneak"]
[editable path="TabContainer/SETTINGS_GRAPHICS/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/Fullscreen"] [editable path="TabContainer/SETTINGS_GRAPHICS/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/Fullscreen"]
[editable path="TabContainer/SETTINGS_GRAPHICS/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/VSync"] [editable path="TabContainer/SETTINGS_GRAPHICS/VBoxContainer/ScrollContainer/MarginContainer/SettingsList/VSync"]

View File

@ -0,0 +1,34 @@
@tool
class_name GameSoundEmitter extends Area3D
## Sends an alert to any intersecting GameSoundListener on command
func _set_collision() -> void:
collision_layer = 0
collision_mask = GameSoundListener.SOUND_COLLISION_LAYER
func _ready() -> void:
_set_collision()
func _process(_delta: float) -> void:
if Engine.is_editor_hint():
_set_collision()
## Trigger a sound detection event on all GameSoundListeners in range.
##
## The source of the sound will be the global position of this emitter.
func emit_sound_here() -> void:
emit_sound(global_position)
## Trigger a sound detection event on all GameSoundListeners in range.
##
## `source` is the global position of the source of the sound.
func emit_sound(source: Vector3) -> void:
print_debug(self, " emitted game sound at ", source)
for body: Node3D in self.get_overlapping_bodies():
if body is GameSoundListener:
(body as GameSoundListener).detect_sound(source)

View File

@ -0,0 +1 @@
uid://c5o1d2shq2qig

View File

@ -0,0 +1,25 @@
@tool
class_name GameSoundListener extends StaticBody3D
## Receives alerts from intersecting GameSoundEmitters
signal sound_detected(source: Vector3)
const SOUND_COLLISION_LAYER := 16
func _set_collision() -> void:
collision_layer = SOUND_COLLISION_LAYER
collision_mask = 0
func _ready() -> void:
_set_collision()
func _process(_delta: float) -> void:
if Engine.is_editor_hint():
_set_collision()
func detect_sound(source: Vector3) -> void:
sound_detected.emit(source)

View File

@ -0,0 +1 @@
uid://cfsiyhhrcua6o

View File

@ -0,0 +1,36 @@
@tool
extends GunkNode
## Fires a trigger signal when a sound is made nearby
signal triggered
@export var quick_connect_to: SignalNode:
set = _editor_connect
@export var splatter_scene: PackedScene
# NOTE
# trigger oscillation animation was generated using the formula
# f(x) = e^(-0.25x) * cos(x * pi / 2 - pi/2) + 1 for x in {0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 20}
@onready var trigger_animation_player: AnimationPlayer = %TriggerAnimationPlayer
@onready var cooldown_timer: Timer = %CooldownTimer
func trigger() -> void:
if not cooldown_timer.is_stopped():
return
# TODO play sfx
trigger_animation_player.play("trigger")
triggered.emit()
cooldown_timer.start()
func _destroy() -> void:
add_sibling(splatter_scene.instantiate())
func _editor_connect(node: SignalNode) -> void:
triggered.connect(node.trigger, CONNECT_PERSIST)
self.notify_property_list_changed()

View File

@ -0,0 +1 @@
uid://bde7cglaqobkd

View File

@ -0,0 +1,98 @@
[gd_scene load_steps=9 format=3 uid="uid://kctp5erogwcb"]
[ext_resource type="Script" uid="uid://bde7cglaqobkd" path="res://src/world/mechanics/listener/listener.gd" id="1_htscg"]
[ext_resource type="PackedScene" uid="uid://xlt78xc1tmkl" path="res://src/effects/grunk_splatter.tscn" id="2_2ibh1"]
[ext_resource type="Script" uid="uid://cfsiyhhrcua6o" path="res://src/world/game_sound/game_sound_listener.gd" id="2_htscg"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_2ibh1"]
data = PackedVector3Array(0, 0.05, 0.25, 0.0957, 0.05, 0.231, 0, -0.05, 0.2, 0.0957, 0.05, 0.231, 0.0765, -0.05, 0.1848, 0, -0.05, 0.2, 0.0957, 0.05, 0.231, 0.1768, 0.05, 0.1768, 0.0765, -0.05, 0.1848, 0.1768, 0.05, 0.1768, 0.1414, -0.05, 0.1414, 0.0765, -0.05, 0.1848, 0.1768, 0.05, 0.1768, 0.231, 0.05, 0.0957, 0.1414, -0.05, 0.1414, 0.231, 0.05, 0.0957, 0.1848, -0.05, 0.0765, 0.1414, -0.05, 0.1414, 0.231, 0.05, 0.0957, 0.25, 0.05, 0, 0.1848, -0.05, 0.0765, 0.25, 0.05, 0, 0.2, -0.05, 0, 0.1848, -0.05, 0.0765, 0.25, 0.05, 0, 0.231, 0.05, -0.0957, 0.2, -0.05, 0, 0.231, 0.05, -0.0957, 0.1848, -0.05, -0.0765, 0.2, -0.05, 0, 0.231, 0.05, -0.0957, 0.1768, 0.05, -0.1768, 0.1848, -0.05, -0.0765, 0.1768, 0.05, -0.1768, 0.1414, -0.05, -0.1414, 0.1848, -0.05, -0.0765, 0.1768, 0.05, -0.1768, 0.0957, 0.05, -0.231, 0.1414, -0.05, -0.1414, 0.0957, 0.05, -0.231, 0.0765, -0.05, -0.1848, 0.1414, -0.05, -0.1414, 0.0957, 0.05, -0.231, 0, 0.05, -0.25, 0.0765, -0.05, -0.1848, 0, 0.05, -0.25, 0, -0.05, -0.2, 0.0765, -0.05, -0.1848, 0, 0.05, -0.25, -0.0957, 0.05, -0.231, 0, -0.05, -0.2, -0.0957, 0.05, -0.231, -0.0765, -0.05, -0.1848, 0, -0.05, -0.2, -0.0957, 0.05, -0.231, -0.1768, 0.05, -0.1768, -0.0765, -0.05, -0.1848, -0.1768, 0.05, -0.1768, -0.1414, -0.05, -0.1414, -0.0765, -0.05, -0.1848, -0.1768, 0.05, -0.1768, -0.231, 0.05, -0.0957, -0.1414, -0.05, -0.1414, -0.231, 0.05, -0.0957, -0.1848, -0.05, -0.0765, -0.1414, -0.05, -0.1414, -0.231, 0.05, -0.0957, -0.25, 0.05, 0, -0.1848, -0.05, -0.0765, -0.25, 0.05, 0, -0.2, -0.05, 0, -0.1848, -0.05, -0.0765, -0.25, 0.05, 0, -0.231, 0.05, 0.0957, -0.2, -0.05, 0, -0.231, 0.05, 0.0957, -0.1848, -0.05, 0.0765, -0.2, -0.05, 0, -0.231, 0.05, 0.0957, -0.1768, 0.05, 0.1768, -0.1848, -0.05, 0.0765, -0.1768, 0.05, 0.1768, -0.1414, -0.05, 0.1414, -0.1848, -0.05, 0.0765, -0.1768, 0.05, 0.1768, -0.0957, 0.05, 0.231, -0.1414, -0.05, 0.1414, -0.0957, 0.05, 0.231, -0.0765, -0.05, 0.1848, -0.1414, -0.05, 0.1414, -0.0957, 0.05, 0.231, 0, 0.05, 0.25, -0.0765, -0.05, 0.1848, 0, 0.05, 0.25, 0, -0.05, 0.2, -0.0765, -0.05, 0.1848, 0, 0.05, 0, 0.0957, 0.05, 0.231, 0, 0.05, 0.25, 0, 0.05, 0, 0.1768, 0.05, 0.1768, 0.0957, 0.05, 0.231, 0, 0.05, 0, 0.231, 0.05, 0.0957, 0.1768, 0.05, 0.1768, 0, 0.05, 0, 0.25, 0.05, 0, 0.231, 0.05, 0.0957, 0, 0.05, 0, 0.231, 0.05, -0.0957, 0.25, 0.05, 0, 0, 0.05, 0, 0.1768, 0.05, -0.1768, 0.231, 0.05, -0.0957, 0, 0.05, 0, 0.0957, 0.05, -0.231, 0.1768, 0.05, -0.1768, 0, 0.05, 0, 0, 0.05, -0.25, 0.0957, 0.05, -0.231, 0, 0.05, 0, -0.0957, 0.05, -0.231, 0, 0.05, -0.25, 0, 0.05, 0, -0.1768, 0.05, -0.1768, -0.0957, 0.05, -0.231, 0, 0.05, 0, -0.231, 0.05, -0.0957, -0.1768, 0.05, -0.1768, 0, 0.05, 0, -0.25, 0.05, 0, -0.231, 0.05, -0.0957, 0, 0.05, 0, -0.231, 0.05, 0.0957, -0.25, 0.05, 0, 0, 0.05, 0, -0.1768, 0.05, 0.1768, -0.231, 0.05, 0.0957, 0, 0.05, 0, -0.0957, 0.05, 0.231, -0.1768, 0.05, 0.1768, 0, 0.05, 0, 0, 0.05, 0.25, -0.0957, 0.05, 0.231, 0, -0.05, 0, 0, -0.05, 0.2, 0.0765, -0.05, 0.1848, 0, -0.05, 0, 0.0765, -0.05, 0.1848, 0.1414, -0.05, 0.1414, 0, -0.05, 0, 0.1414, -0.05, 0.1414, 0.1848, -0.05, 0.0765, 0, -0.05, 0, 0.1848, -0.05, 0.0765, 0.2, -0.05, 0, 0, -0.05, 0, 0.2, -0.05, 0, 0.1848, -0.05, -0.0765, 0, -0.05, 0, 0.1848, -0.05, -0.0765, 0.1414, -0.05, -0.1414, 0, -0.05, 0, 0.1414, -0.05, -0.1414, 0.0765, -0.05, -0.1848, 0, -0.05, 0, 0.0765, -0.05, -0.1848, 0, -0.05, -0.2, 0, -0.05, 0, 0, -0.05, -0.2, -0.0765, -0.05, -0.1848, 0, -0.05, 0, -0.0765, -0.05, -0.1848, -0.1414, -0.05, -0.1414, 0, -0.05, 0, -0.1414, -0.05, -0.1414, -0.1848, -0.05, -0.0765, 0, -0.05, 0, -0.1848, -0.05, -0.0765, -0.2, -0.05, 0, 0, -0.05, 0, -0.2, -0.05, 0, -0.1848, -0.05, 0.0765, 0, -0.05, 0, -0.1848, -0.05, 0.0765, -0.1414, -0.05, 0.1414, 0, -0.05, 0, -0.1414, -0.05, 0.1414, -0.0765, -0.05, 0.1848, 0, -0.05, 0, -0.0765, -0.05, 0.1848, 0, -0.05, 0.2)
[sub_resource type="CylinderMesh" id="CylinderMesh_ud3xk"]
top_radius = 0.25
bottom_radius = 0.2
height = 0.1
radial_segments = 16
rings = 0
[sub_resource type="Animation" id="Animation_htscg"]
resource_name = "trigger"
length = 2.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape3D:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 1.7, 1.9, 2),
"transitions": PackedFloat32Array(0.618, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Vector3(1, 1, 1), Vector3(1.779, 1.779, 1.779), Vector3(0.528, 0.528, 0.528), Vector3(1.287, 1.287, 1.287), Vector3(0.826, 0.826, 0.826), Vector3(1.105, 1.105, 1.105), Vector3(0.936, 0.936, 0.936), Vector3(1.039, 1.039, 1.039), Vector3(0.976, 0.976, 0.976), Vector3(1.014, 1.014, 1.014), Vector3(0.991, 0.991, 0.991), Vector3(1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_2ibh1"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape3D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2ibh1"]
_data = {
&"RESET": SubResource("Animation_2ibh1"),
&"trigger": SubResource("Animation_htscg")
}
[node name="Listener" type="StaticBody3D"]
collision_layer = 5
collision_mask = 0
script = ExtResource("1_htscg")
splatter_scene = ExtResource("2_2ibh1")
durability = 3.0
value = 4000.0
metadata/_custom_type_script = "uid://bypgxi0gy56yk"
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0)
shape = SubResource("ConcavePolygonShape3D_2ibh1")
[node name="GameSoundListener" type="StaticBody3D" parent="CollisionShape3D"]
collision_layer = 16
collision_mask = 0
script = ExtResource("2_htscg")
metadata/_custom_type_script = "uid://cfsiyhhrcua6o"
[node name="CollisionShape3D" type="CollisionShape3D" parent="CollisionShape3D/GameSoundListener"]
shape = SubResource("ConcavePolygonShape3D_2ibh1")
[node name="MeshInstance3D" type="MeshInstance3D" parent="CollisionShape3D"]
mesh = SubResource("CylinderMesh_ud3xk")
skeleton = NodePath("../..")
[node name="Label3D" type="Label3D" parent="CollisionShape3D/MeshInstance3D"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.051, 0)
pixel_size = 0.001
text = "LISTENER"
font_size = 92
outline_size = 20
[node name="CooldownTimer" type="Timer" parent="."]
unique_name_in_owner = true
wait_time = 4.0
one_shot = true
[node name="TriggerAnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_2ibh1")
}
[connection signal="sound_detected" from="CollisionShape3D/GameSoundListener" to="." method="trigger" unbinds=1]