Add door sounds

This commit is contained in:
Hamcha 2020-07-20 15:04:56 +02:00
parent 187a46eabd
commit f8d6c29d06
Signed by: hamcha
GPG Key ID: 41467804B19A3315
19 changed files with 151 additions and 12 deletions

View File

@ -105,7 +105,6 @@ func _force_close_ui():
$Control/ControlComp.force_close()
func _power_status_changed(powered: bool) -> void:
print(name, " is ", powered)
activationRange.visible = powered
if powered:
$ScreenAnimation.play("on")

View File

@ -5,6 +5,9 @@ class_name GameObjectDoor
export(NodePath) var interlockTargetPath
var interlockTarget: GameObjectDoor = null
var open_sound = preload("res://Sounds/SFX/door-open.wav")
var close_sound = preload("res://Sounds/SFX/door-close.wav")
export var idle_usage = 2
export var active_usage = 10
@ -33,8 +36,11 @@ master func set_open(open: bool):
remotesync func anim_open(open: bool):
if open:
$Sprite.play("open")
$AudioStreamPlayer2D.stream = open_sound
else:
$Sprite.play("close")
$AudioStreamPlayer2D.stream = close_sound
$AudioStreamPlayer2D.play()
func _animation_finished():
if is_network_master():

View File

@ -82,6 +82,10 @@ shape = SubResource( 8 )
[node name="PowerManager" type="Node" parent="."]
script = ExtResource( 4 )
power_usage = 2.0
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
max_distance = 512.0
attenuation = 3.0
[connection signal="animation_finished" from="Sprite" to="." method="_animation_finished"]
[connection signal="timeout" from="Timer" to="." method="_close_timer_triggered"]
[connection signal="player_entered" from="CloseRange" to="." method="_open_sensor_triggered"]

View File

@ -99,3 +99,6 @@ func draw_circle_arc_poly(center, radius, angle_from, angle_to, color):
var angle_point = deg2rad(angle_from + i * (angle_to - angle_from) / nb_points - 90)
points_arc.push_back(center + Vector2(cos(angle_point), sin(angle_point)) * radius)
draw_polygon(points_arc, colors)
func _heard(area):
pass #TODO Sounds

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Graphics/tgstation/sprites/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://Actors/Player/Player.gd" type="Script" id=2]
@ -7,6 +7,9 @@
radius = 10.4436
height = 5.44386
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 32, 32 )
[node name="Player" type="KinematicBody2D"]
z_index = 10
collision_layer = 8
@ -19,3 +22,12 @@ position = Vector2( 0, -3 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Earing" type="Area2D" parent="."]
monitorable = false
collision_layer = 32
collision_mask = 32
[node name="CollisionShape2D" type="CollisionShape2D" parent="Earing"]
shape = SubResource( 2 )
[connection signal="area_entered" from="Earing" to="." method="_heard"]

View File

@ -26,10 +26,6 @@ func _ready():
scout()
update()
func _physics_process(delta):
if Engine.editor_hint:
update()
func scout():
# Reset lists
cells = {}

18
CREDITS.md Normal file
View File

@ -0,0 +1,18 @@
# Graphics
- Title screen background: [Star Nest by Pablo Roman Andrioli](https://www.shadertoy.com/view/XlfGRj) (MIT)
- All graphics in `Graphics/tgstation` is from [/tg/station](https://github.com/tgstation/tgstation) (CC 3.0 BY-SA)
# Music
- Title screen music: [Je suis un Phoenix by BlueMillenium](http://ccmixter.org/files/Bluemillenium/61325) (CC 3.0 BY-NC)
# Sound effects
- Door open/close sounds:
- [Hatch Seal.wav by Paul368 (freesound)](https://freesound.org/people/Paul368/sounds/264063/) (CC0)
- [SFX Door Open.wav by Paul368 (freesound)](https://freesound.org/people/Paul368/sounds/264061/) (CC0)
# Code
- Uses the [GOTM API library](https://github.com/PlayGotm/GDGotm) from Macaroni Studios (MIT)

View File

@ -8,9 +8,6 @@ Takes heavy inspiration (and for now, graphics) from Space Station 13 and FTL.
## Credits
- Title screen music: [Je suis un Phoenix by BlueMillenium](http://ccmixter.org/files/Bluemillenium/61325) (CC 3.0 BY-NC)
- Title screen background: [Star Nest by Pablo Roman Andrioli](https://www.shadertoy.com/view/XlfGRj) (MIT)
- All graphics in `Graphics/tgstation` is taken from [/tg/station](https://github.com/tgstation/tgstation) (CC 3.0 BY-SA)
- Uses the [GOTM API library](https://github.com/PlayGotm/GDGotm) from Macaroni Studios (MIT)
See `CREDITS.md` for an exhaustive list of sources for all assets not made by me (Hamcha)
See `LICENSE` for code license (TL;DR it's [ISC](https://en.wikipedia.org/wiki/ISC_license))

View File

@ -94,7 +94,7 @@ anchor_bottom = 1.0
margin_left = 10.0
margin_top = 40.0
margin_right = -10.0
margin_bottom = -10.0
margin_bottom = -40.0
focus_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
@ -111,7 +111,9 @@ __meta__ = {
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_bottom = 24.0
margin_left = 10.0
margin_top = -30.0
margin_right = -10.0
focus_mode = 1
__meta__ = {
"_edit_use_anchors_": false

BIN
Sounds/SFX/door-close.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/door-close.wav-1faad6bf3be9b5e52678e401977fe00a.sample"
[deps]
source_file="res://Sounds/SFX/door-close.wav"
dest_files=[ "res://.import/door-close.wav-1faad6bf3be9b5e52678e401977fe00a.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=1

BIN
Sounds/SFX/door-open.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/door-open.wav-3c5c5376563179dedddb5fd7fd542243.sample"
[deps]
source_file="res://Sounds/SFX/door-open.wav"
dest_files=[ "res://.import/door-open.wav-3c5c5376563179dedddb5fd7fd542243.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=1

BIN
Sounds/SFX/door-sound.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/door-sound.wav-ac68dc9d9bb353e0d4a064d3f6b8439c.sample"
[deps]
source_file="res://Sounds/SFX/door-sound.wav"
dest_files=[ "res://.import/door-sound.wav-ac68dc9d9bb353e0d4a064d3f6b8439c.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=1

View File

@ -0,0 +1,38 @@
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
<project xmlns="http://audacity.sourceforge.net/xml/" projname="door-sound_data" version="1.3.0" audacityversion="2.3.3" sel0="0.0000000000" sel1="0.0000000000" vpos="0" h="0.0000000000" zoom="300.2769352499" rate="48000.0" snapto="off" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
<tags/>
<wavetrack name="door-sound" isSelected="0" height="150" minimized="0" channel="2" linked="0" mute="0" solo="0" rate="48000" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="116852">
<waveblock start="0">
<simpleblockfile filename="e0808e31.au" len="116852" min="-1.0" max="1.0" rms="0.106046"/>
</waveblock>
</sequence>
<envelope numpoints="5">
<controlpoint t="0.725996486605" val="1.000000000000"/>
<controlpoint t="0.825904259991" val="0.620437979698"/>
<controlpoint t="0.855876592007" val="0.562043786049"/>
<controlpoint t="0.929142292490" val="0.445255458355"/>
<controlpoint t="1.032380324989" val="0.028169035912"/>
</envelope>
</waveclip>
</wavetrack>
<wavetrack name="264061__paul368__sfx-door-open" isSelected="1" height="150" minimized="0" channel="2" linked="0" mute="0" solo="0" rate="48000" gain="0.501187" pan="0.0" colorindex="0">
<waveclip offset="0.22643750" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="85596">
<waveblock start="0">
<simpleblockfile filename="e0808367.au" len="85596" min="-0.316331" max="0.389588" rms="0.023447"/>
</waveblock>
</sequence>
<envelope numpoints="6">
<controlpoint t="0.046643747255" val="0.514084517956"/>
<controlpoint t="0.166533075318" val="1.000000000000"/>
<controlpoint t="0.476247172815" val="0.971830964088"/>
<controlpoint t="0.749328420070" val="0.816901445389"/>
<controlpoint t="0.885869043698" val="0.598591566086"/>
<controlpoint t="1.022409667325" val="0.267605662346"/>
</envelope>
</waveclip>
</wavetrack>
</project>

Binary file not shown.

Binary file not shown.

View File

@ -272,6 +272,7 @@ sprint={
2d_physics/layer_3="Electric"
2d_physics/layer_4="Actors"
2d_physics/layer_5="AreaBound"
2d_physics/layer_6="Sound"
[rendering]