Player ship has door with open/close sfx

This commit is contained in:
Rob Kelly 2025-04-02 11:56:22 -06:00
parent f966dc43df
commit 8a53349aef
10 changed files with 172 additions and 1 deletions

Binary file not shown.

BIN
assets/sfx/space_door.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b601aiv71ddra"
path="res://.godot/imported/space_door.wav-cfdcf19076b3529fb20c9d5c6a8ba845.sample"
[deps]
source_file="res://assets/sfx/space_door.wav"
dest_files=["res://.godot/imported/space_door.wav-cfdcf19076b3529fb20c9d5c6a8ba845.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

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bckqqojs6pcu1"
path="res://.godot/imported/space_door_close.wav-b63dd0d5ac81269fa735a415c4610094.sample"
[deps]
source_file="res://assets/sfx/space_door_close.wav"
dest_files=["res://.godot/imported/space_door_close.wav-b63dd0d5ac81269fa735a415c4610094.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

View File

@ -0,0 +1,15 @@
extends Area3D
@onready var door_animation: AnimationPlayer = %DoorAnimation
@onready var open_sfx: AudioStreamPlayer3D = %OpenSFX
@onready var close_sfx: AudioStreamPlayer3D = %CloseSFX
func _on_body_entered(_body: Node3D) -> void:
door_animation.play("open")
open_sfx.play()
func _on_body_exited(_body: Node3D) -> void:
door_animation.play_backwards("open")
close_sfx.play()

View File

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

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=29 format=3 uid="uid://oowut88kr2ox"] [gd_scene load_steps=42 format=3 uid="uid://oowut88kr2ox"]
[ext_resource type="Script" uid="uid://lfd36ps52xgk" path="res://levels/ghost_ship/player_ship/player_ship.gd" id="1_0r2ng"] [ext_resource type="Script" uid="uid://lfd36ps52xgk" path="res://levels/ghost_ship/player_ship/player_ship.gd" id="1_0r2ng"]
[ext_resource type="ArrayMesh" uid="uid://dq4aj5ph31rce" path="res://assets/level/player_ship/player_ship.obj" id="1_nafoa"] [ext_resource type="ArrayMesh" uid="uid://dq4aj5ph31rce" path="res://assets/level/player_ship/player_ship.obj" id="1_nafoa"]
@ -15,6 +15,12 @@
[ext_resource type="PackedScene" uid="uid://mgygam1kakb7" path="res://levels/ghost_ship/player_ship/grunk_terminal/grunk_terminal.tscn" id="13_3trrp"] [ext_resource type="PackedScene" uid="uid://mgygam1kakb7" path="res://levels/ghost_ship/player_ship/grunk_terminal/grunk_terminal.tscn" id="13_3trrp"]
[ext_resource type="Script" uid="uid://vewq8h8uulbg" path="res://src/util/translator_path_3d.gd" id="13_i4yi7"] [ext_resource type="Script" uid="uid://vewq8h8uulbg" path="res://src/util/translator_path_3d.gd" id="13_i4yi7"]
[ext_resource type="AudioStream" uid="uid://c838ofbu4bqrn" path="res://assets/sfx/computer_noise.wav" id="14_was05"] [ext_resource type="AudioStream" uid="uid://c838ofbu4bqrn" path="res://assets/sfx/computer_noise.wav" id="14_was05"]
[ext_resource type="Script" uid="uid://ck3yvtm42i1h4" path="res://levels/ghost_ship/player_ship/door_area.gd" id="16_kkevb"]
[ext_resource type="Texture2D" uid="uid://nexcq3xxrebb" path="res://assets/props/bulkhead/bulkhead_door_M.png" id="16_nps14"]
[ext_resource type="Texture2D" uid="uid://dk4sm780p6jfc" path="res://assets/props/bulkhead/bulkhead_door_N.png" id="17_kkevb"]
[ext_resource type="Texture2D" uid="uid://rjuyd20y2ov1" path="res://assets/props/bulkhead/bulkhead_door_R.png" id="18_3rulp"]
[ext_resource type="AudioStream" uid="uid://b601aiv71ddra" path="res://assets/sfx/space_door.wav" id="20_3rulp"]
[ext_resource type="AudioStream" uid="uid://bckqqojs6pcu1" path="res://assets/sfx/space_door_close.wav" id="21_bmg36"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xpsdy"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xpsdy"]
transparency = 1 transparency = 1
@ -218,6 +224,63 @@ _data = {
&"jangle": SubResource("Animation_i4yi7") &"jangle": SubResource("Animation_i4yi7")
} }
[sub_resource type="BoxShape3D" id="BoxShape3D_nps14"]
size = Vector3(3, 3, 4)
[sub_resource type="Animation" id="Animation_nps14"]
resource_name = "open"
length = 0.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Door:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, -0.3, 0), Vector3(0, 2.25, 0)]
}
[sub_resource type="Animation" id="Animation_kkevb"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Door:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, -0.3, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_kkevb"]
_data = {
&"RESET": SubResource("Animation_kkevb"),
&"open": SubResource("Animation_nps14")
}
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bmg36"]
metallic = 1.0
metallic_texture = ExtResource("16_nps14")
roughness_texture = ExtResource("18_3rulp")
normal_enabled = true
normal_texture = ExtResource("17_kkevb")
ao_enabled = true
uv1_scale = Vector3(3, 2, 1)
texture_filter = 2
[sub_resource type="BoxMesh" id="BoxMesh_i4yi7"]
material = SubResource("StandardMaterial3D_bmg36")
size = Vector3(1.25, 2.5, 0.1)
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_0e0pl"]
data = PackedVector3Array(-0.625, 1.25, 0.05, 0.625, 1.25, 0.05, -0.625, -1.25, 0.05, 0.625, 1.25, 0.05, 0.625, -1.25, 0.05, -0.625, -1.25, 0.05, 0.625, 1.25, -0.05, -0.625, 1.25, -0.05, 0.625, -1.25, -0.05, -0.625, 1.25, -0.05, -0.625, -1.25, -0.05, 0.625, -1.25, -0.05, 0.625, 1.25, 0.05, 0.625, 1.25, -0.05, 0.625, -1.25, 0.05, 0.625, 1.25, -0.05, 0.625, -1.25, -0.05, 0.625, -1.25, 0.05, -0.625, 1.25, -0.05, -0.625, 1.25, 0.05, -0.625, -1.25, -0.05, -0.625, 1.25, 0.05, -0.625, -1.25, 0.05, -0.625, -1.25, -0.05, 0.625, 1.25, 0.05, -0.625, 1.25, 0.05, 0.625, 1.25, -0.05, -0.625, 1.25, 0.05, -0.625, 1.25, -0.05, 0.625, 1.25, -0.05, -0.625, -1.25, 0.05, 0.625, -1.25, 0.05, -0.625, -1.25, -0.05, 0.625, -1.25, 0.05, 0.625, -1.25, -0.05, -0.625, -1.25, -0.05)
[node name="PlayerShip" type="Node3D"] [node name="PlayerShip" type="Node3D"]
script = ExtResource("1_0r2ng") script = ExtResource("1_0r2ng")
@ -299,4 +362,48 @@ libraries = {
&"": SubResource("AnimationLibrary_fw23o") &"": SubResource("AnimationLibrary_fw23o")
} }
[node name="DoorArea" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.55, -4.625)
collision_layer = 0
collision_mask = 8
script = ExtResource("16_kkevb")
[node name="CollisionShape3D" type="CollisionShape3D" parent="DoorArea"]
shape = SubResource("BoxShape3D_nps14")
[node name="DoorAnimation" type="AnimationPlayer" parent="DoorArea"]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_kkevb")
}
[node name="Door" type="MeshInstance3D" parent="DoorArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.3, 0)
mesh = SubResource("BoxMesh_i4yi7")
skeleton = NodePath("../..")
[node name="StaticBody3D" type="StaticBody3D" parent="DoorArea/Door"]
collision_layer = 5
[node name="CollisionShape3D" type="CollisionShape3D" parent="DoorArea/Door/StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_0e0pl")
[node name="OpenSFX" type="AudioStreamPlayer3D" parent="DoorArea/Door"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.2, 0)
stream = ExtResource("20_3rulp")
volume_db = -20.0
unit_size = 3.0
bus = &"SFX"
[node name="CloseSFX" type="AudioStreamPlayer3D" parent="DoorArea/Door"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.2, 0)
stream = ExtResource("21_bmg36")
volume_db = -16.0
unit_size = 4.0
bus = &"SFX"
[connection signal="activated" from="TankInteractor" to="." method="deposit_grunk"] [connection signal="activated" from="TankInteractor" to="." method="deposit_grunk"]
[connection signal="body_entered" from="DoorArea" to="DoorArea" method="_on_body_entered"]
[connection signal="body_exited" from="DoorArea" to="DoorArea" method="_on_body_exited"]