diff --git a/Actors/Objects/Computer/Computer.gd b/Actors/Objects/Computer/Computer.gd index c874a86..1279123 100644 --- a/Actors/Objects/Computer/Computer.gd +++ b/Actors/Objects/Computer/Computer.gd @@ -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") diff --git a/Actors/Objects/Door/Door.gd b/Actors/Objects/Door/Door.gd index 4c2d901..4abce11 100644 --- a/Actors/Objects/Door/Door.gd +++ b/Actors/Objects/Door/Door.gd @@ -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(): diff --git a/Actors/Objects/Door/Door.tscn b/Actors/Objects/Door/Door.tscn index 529d97d..b572aae 100644 --- a/Actors/Objects/Door/Door.tscn +++ b/Actors/Objects/Door/Door.tscn @@ -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"] diff --git a/Actors/Player/Player.gd b/Actors/Player/Player.gd index 7c4a84c..974e413 100644 --- a/Actors/Player/Player.gd +++ b/Actors/Player/Player.gd @@ -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 diff --git a/Actors/Player/Player.tscn b/Actors/Player/Player.tscn index 09b1916..58998eb 100644 --- a/Actors/Player/Player.tscn +++ b/Actors/Player/Player.tscn @@ -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"] diff --git a/Actors/Systems/Area/AreaProbe.gd b/Actors/Systems/Area/AreaProbe.gd index cefb311..68205bf 100644 --- a/Actors/Systems/Area/AreaProbe.gd +++ b/Actors/Systems/Area/AreaProbe.gd @@ -26,10 +26,6 @@ func _ready(): scout() update() -func _physics_process(delta): - if Engine.editor_hint: - update() - func scout(): # Reset lists cells = {} diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..bf3987e --- /dev/null +++ b/CREDITS.md @@ -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) diff --git a/README.md b/README.md index f8d6602..d088404 100644 --- a/README.md +++ b/README.md @@ -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)) diff --git a/Scenes/UI/Widgets/ResizablePanel.tscn b/Scenes/UI/Widgets/ResizablePanel.tscn index e8c8fc0..5b5bb78 100644 --- a/Scenes/UI/Widgets/ResizablePanel.tscn +++ b/Scenes/UI/Widgets/ResizablePanel.tscn @@ -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 diff --git a/Sounds/SFX/door-close.wav b/Sounds/SFX/door-close.wav new file mode 100644 index 0000000..8f72eee Binary files /dev/null and b/Sounds/SFX/door-close.wav differ diff --git a/Sounds/SFX/door-close.wav.import b/Sounds/SFX/door-close.wav.import new file mode 100644 index 0000000..ef5e1e8 --- /dev/null +++ b/Sounds/SFX/door-close.wav.import @@ -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 diff --git a/Sounds/SFX/door-open.wav b/Sounds/SFX/door-open.wav new file mode 100644 index 0000000..becce5b Binary files /dev/null and b/Sounds/SFX/door-open.wav differ diff --git a/Sounds/SFX/door-open.wav.import b/Sounds/SFX/door-open.wav.import new file mode 100644 index 0000000..b251b74 --- /dev/null +++ b/Sounds/SFX/door-open.wav.import @@ -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 diff --git a/Sounds/SFX/door-sound.wav b/Sounds/SFX/door-sound.wav new file mode 100644 index 0000000..33c37f0 Binary files /dev/null and b/Sounds/SFX/door-sound.wav differ diff --git a/Sounds/SFX/door-sound.wav.import b/Sounds/SFX/door-sound.wav.import new file mode 100644 index 0000000..cc5e939 --- /dev/null +++ b/Sounds/SFX/door-sound.wav.import @@ -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 diff --git a/Sounds/SFX/sources/door-sound.aup b/Sounds/SFX/sources/door-sound.aup new file mode 100644 index 0000000..e49824f --- /dev/null +++ b/Sounds/SFX/sources/door-sound.aup @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sounds/SFX/sources/door-sound_data/e08/d08/e0808367.au b/Sounds/SFX/sources/door-sound_data/e08/d08/e0808367.au new file mode 100644 index 0000000..1ac8174 Binary files /dev/null and b/Sounds/SFX/sources/door-sound_data/e08/d08/e0808367.au differ diff --git a/Sounds/SFX/sources/door-sound_data/e08/d08/e0808e31.au b/Sounds/SFX/sources/door-sound_data/e08/d08/e0808e31.au new file mode 100644 index 0000000..28cb51b Binary files /dev/null and b/Sounds/SFX/sources/door-sound_data/e08/d08/e0808e31.au differ diff --git a/project.godot b/project.godot index 4d958d1..a8f5b0b 100644 --- a/project.godot +++ b/project.godot @@ -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]