Skip to content

Commit

Permalink
added dynamic audio triggers to scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
dobios committed Jan 29, 2023
1 parent bb0bed2 commit d69a09c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 24 deletions.
16 changes: 13 additions & 3 deletions scenes/Brasserie/Brasserie.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=153 format=2]
[gd_scene load_steps=154 format=2]

[ext_resource path="res://assets/02_architecture/03_brewery/backGround.png" type="Texture" id=1]
[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=2]
Expand Down Expand Up @@ -42,6 +42,7 @@
[ext_resource path="res://scenes/Interaction/PressTab.tscn" type="PackedScene" id=40]
[ext_resource path="res://assets/07_sounds/Sounds/Smelter burning_1.wav" type="AudioStream" id=41]
[ext_resource path="res://src/FountainAudio.cs" type="Script" id=42]
[ext_resource path="res://src/WalkingSoundTrigger.cs" type="Script" id=43]

[sub_resource type="RectangleShape2D" id=130]
extents = Vector2( 21, 10 )
Expand Down Expand Up @@ -1283,6 +1284,7 @@ __meta__ = {
[node name="Sprite" type="AnimatedSprite" parent="YSort/Props/Cuve"]
position = Vector2( 0, 6 )
frames = SubResource( 128 )
frame = 17
playing = true

[node name="CollisionShape2D" type="CollisionPolygon2D" parent="YSort/Props/Cuve"]
Expand Down Expand Up @@ -1408,7 +1410,6 @@ __meta__ = {

[node name="AnimatedSprite" type="AnimatedSprite" parent="YSort/Props/Bookshelf"]
frames = SubResource( 81 )
frame = 4
playing = true

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="YSort/Props/Bookshelf"]
Expand All @@ -1422,6 +1423,7 @@ __meta__ = {

[node name="AnimatedSprite" type="AnimatedSprite" parent="YSort/Props/Bookshelf2"]
frames = SubResource( 81 )
frame = 4
playing = true
flip_h = true

Expand All @@ -1437,7 +1439,7 @@ __meta__ = {
[node name="AnimatedSprite" type="AnimatedSprite" parent="YSort/Props/Desk"]
frames = ExtResource( 21 )
animation = "desk"
frame = 1
frame = 31
playing = true

[node name="CollisionShape2D" type="CollisionShape2D" parent="YSort/Props/Desk"]
Expand Down Expand Up @@ -1853,6 +1855,14 @@ pitch_scale = 0.81
autoplay = true
script = ExtResource( 42 )

[node name="StoneAudioTrigger" type="Area2D" parent="."]
script = ExtResource( 43 )
EnterType = 3
ExitType = 2

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StoneAudioTrigger"]
polygon = PoolVector2Array( 241, 328, 291, 328, 587, 330, 585, 183, 285, 182, 287, 237, 262, 237, 262, 263, 235, 266, 218, 266, 197, 237, 194, 331 )

[connection signal="OpenNotebook" from="YSort/Player" to="Notebook" method="_on_NotebookController_pressed"]
[connection signal="SlideInNotebookController" from="YSort/Player" to="NotebookControllerNode/NotebookController" method="_on_Player_SlideInNotebookController"]
[connection signal="visibility_changed" from="Notebook" to="Book" method="_on_Notebook_visibility_changed"]
Expand Down
18 changes: 13 additions & 5 deletions scenes/Casino/Casino.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=60 format=2]
[gd_scene load_steps=61 format=2]

[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/02_architecture/04_casino/casino.png" type="Texture" id=2]
Expand Down Expand Up @@ -27,7 +27,7 @@
[ext_resource path="res://assets/02_architecture/01_genericPieces/03_furniture/bench.png" type="Texture" id=25]
[ext_resource path="res://assets/01_characters/03_pnjs/henriFischer-Sheet.png" type="Texture" id=26]
[ext_resource path="res://scenes/Flon/GrassTileSet.tres" type="TileSet" id=27]
[ext_resource path="res://assets/07_sounds/Sounds/grass/0.ogg" type="AudioStream" id=28]
[ext_resource path="res://src/WalkingSoundTrigger.cs" type="Script" id=28]
[ext_resource path="res://src/FountainAudio.cs" type="Script" id=29]
[ext_resource path="res://assets/07_sounds/Sounds/Forest Loop.wav" type="AudioStream" id=30]

Expand Down Expand Up @@ -139,6 +139,9 @@ radius = 8.0
size = 9
font_data = ExtResource( 17 )

[sub_resource type="RectangleShape2D" id=31]
extents = Vector2( 7.5, 121.5 )

[sub_resource type="RectangleShape2D" id=30]
extents = Vector2( 34.27, 10 )

Expand Down Expand Up @@ -267,9 +270,6 @@ position = Vector2( 191, 432 )
[node name="AnimationTree" parent="YSort/Player" index="4"]
parameters/playback = SubResource( 20 )

[node name="AudioStreamPlayer" parent="YSort/Player" index="6"]
stream = ExtResource( 28 )

[node name="Perregaux" parent="YSort" instance=ExtResource( 8 )]
position = Vector2( 305, 248 )
InitDir = 1
Expand Down Expand Up @@ -1600,6 +1600,14 @@ __meta__ = {
"_edit_lock_": true
}

[node name="PathAudioTrigger" type="Area2D" parent="."]
script = ExtResource( 28 )
ExitType = 1

[node name="CollisionShape2D" type="CollisionShape2D" parent="PathAudioTrigger"]
position = Vector2( 190.5, 244.5 )
shape = SubResource( 31 )

[node name="PlayerEnterArea" type="Area2D" parent="."]

[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerEnterArea"]
Expand Down
4 changes: 2 additions & 2 deletions scenes/Flon/Flon.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ position = Vector2( 283, 200 )
[node name="Sprite" type="AnimatedSprite" parent="YSort/House2"]
position = Vector2( 0, -101 )
frames = SubResource( 84 )
frame = 7
frame = 4
playing = true

[node name="CollisionShape2D" type="CollisionPolygon2D" parent="YSort/House2"]
Expand Down Expand Up @@ -1670,7 +1670,7 @@ __meta__ = {

[node name="AnimatedSprite" type="AnimatedSprite" parent="YSort/Manure"]
frames = SubResource( 73 )
frame = 2
frame = 1
playing = true

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="YSort/Manure"]
Expand Down
22 changes: 16 additions & 6 deletions scenes/Intro/Intro.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=66 format=2]
[gd_scene load_steps=67 format=2]

[ext_resource path="res://scenes/Brasserie/DeskAnim.tres" type="SpriteFrames" id=1]
[ext_resource path="res://assets/02_architecture/06_questRoom/background.png" type="Texture" id=2]
Expand Down Expand Up @@ -26,6 +26,7 @@
[ext_resource path="res://assets/06_UI_menus/fr/wasd.png" type="Texture" id=24]
[ext_resource path="res://assets/05_fonts/PixelOperator-Bold.ttf" type="DynamicFontData" id=25]
[ext_resource path="res://src/TextLabel.cs" type="Script" id=26]
[ext_resource path="res://src/WalkingSoundTrigger.cs" type="Script" id=27]

[sub_resource type="RectangleShape2D" id=39]
extents = Vector2( 10, 87.8739 )
Expand Down Expand Up @@ -519,7 +520,7 @@ one_way_collision = true
position = Vector2( 334.266, 136.727 )
frames = ExtResource( 1 )
animation = "desk"
frame = 33
frame = 28
playing = true

[node name="CollisionShape2D" type="CollisionShape2D" parent="Desk"]
Expand All @@ -535,12 +536,8 @@ position = Vector2( 0, -11 )

[node name="Label" parent="Desk/Letter/Sprite" index="0"]
text = ""
script = ExtResource( 26 )
id = "gp_read"

[node name="AnimatedSprite" parent="Desk/Letter/Sprite" index="1"]
frame = 0

[node name="CollisionShape2D" parent="Desk/Letter/Area2D" index="0"]
position = Vector2( -14, 5 )
shape = SubResource( 29 )
Expand All @@ -562,6 +559,7 @@ texture = ExtResource( 21 )
[node name="PressE" parent="Desk/Letter/Open" index="3" instance=ExtResource( 17 )]
position = Vector2( -295, 186 )
scale = Vector2( 2, 2 )
frame = 0

[node name="Label" type="Label" parent="Desk/Letter/Open" index="4"]
margin_left = -279.0
Expand Down Expand Up @@ -772,11 +770,23 @@ id = "tuto_interact"
[node name="PressE" parent="Label2" instance=ExtResource( 17 )]
position = Vector2( 70, 56 )
scale = Vector2( 2, 2 )
frame = 0

[node name="Timer" type="Timer" parent="."]
wait_time = 2.0
autostart = true

[node name="WoodAudioTrigger" type="Area2D" parent="."]
position = Vector2( 387.904, 196.892 )
rotation = 3.14159
scale = Vector2( 83.4498, 40.2482 )
script = ExtResource( 27 )
EnterType = 2
ExitType = 2

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="WoodAudioTrigger"]
polygon = PoolVector2Array( -0.636259, -1.36921, 0.478183, -1.31952, 0.478183, -0.822607, 0.741815, -0.822607, 0.741815, -0.598994, -0.636259, -0.598994 )

[node name="PlayerEnterArea" type="Area2D" parent="."]
scale = Vector2( -3.80679, -0.367396 )

Expand Down
31 changes: 23 additions & 8 deletions scenes/Palud/ProtoPalud.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=130 format=2]
[gd_scene load_steps=131 format=2]

[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/FountainAudio.cs" type="Script" id=2]
Expand Down Expand Up @@ -47,6 +47,7 @@
[ext_resource path="res://assets/02_architecture/02_palud/affiches.png" type="Texture" id=45]
[ext_resource path="res://src/TextSprite.cs" type="Script" id=46]
[ext_resource path="res://src/TextLabel.cs" type="Script" id=47]
[ext_resource path="res://src/WalkingSoundTrigger.cs" type="Script" id=48]

[sub_resource type="TileSet" id=4]
6/name = "pavedGround-Sheet.png 6"
Expand Down Expand Up @@ -1139,9 +1140,6 @@ HasAutoDialogue = false
z_index = 1
NPCName = " Elisabeth De Cerjeat "

[node name="AnimatedSprite" parent="YSort/NPC/Elisabeth/TextBox" index="2"]
frame = 1

[node name="FullyAnimated" parent="YSort/NPC/Elisabeth" index="2"]
texture = ExtResource( 12 )

Expand Down Expand Up @@ -1332,6 +1330,9 @@ position = Vector2( 11.0124, -17.6866 )
[node name="Label" parent="YSort/Cuir/Sprite" index="0"]
text = "Regarder"

[node name="AnimatedSprite" parent="YSort/Cuir/Sprite" index="1"]
frame = 0

[node name="CollisionShape2D" parent="YSort/Cuir/Area2D" index="0"]
position = Vector2( 3.69278, -0.155334 )
shape = SubResource( 40 )
Expand All @@ -1348,7 +1349,6 @@ margin_bottom = 422.297
[node name="PressE" parent="YSort/Cuir/Open" index="1" instance=ExtResource( 40 )]
position = Vector2( -457, 50 )
scale = Vector2( 1, 1 )
frame = 0

[node name="Label2" type="Label" parent="YSort/Cuir/Open" index="2"]
margin_left = -445.0
Expand All @@ -1373,13 +1373,13 @@ resourcePath = "06_UI_menus"
[node name="Cuir2" type="AnimatedSprite" parent="YSort"]
position = Vector2( 482, 295 )
frames = SubResource( 61 )
frame = 22
frame = 12
playing = true

[node name="AfficheSprite" type="AnimatedSprite" parent="YSort"]
position = Vector2( 51.5568, 190.668 )
frames = SubResource( 79 )
frame = 1
frame = 6
playing = true

[node name="Affiche" parent="YSort" instance=ExtResource( 16 )]
Expand All @@ -1392,6 +1392,9 @@ visible = false
[node name="Label" parent="YSort/Affiche/Sprite" index="0"]
text = "Regarder"

[node name="AnimatedSprite" parent="YSort/Affiche/Sprite" index="1"]
frame = 0

[node name="Open" parent="YSort/Affiche" index="2"]
visible = false

Expand Down Expand Up @@ -1419,7 +1422,6 @@ id = "gp_close"
[node name="PressE" parent="YSort/Affiche/Open" index="2" instance=ExtResource( 40 )]
position = Vector2( -38, 155 )
scale = Vector2( 1, 1 )
frame = 0

[node name="Sprite" type="Sprite" parent="YSort/Affiche/Open" index="3"]
position = Vector2( 265, 0 )
Expand Down Expand Up @@ -1490,6 +1492,19 @@ volume_db = -10.0
autoplay = true
bus = "Sounds"

[node name="StoneAudioTrigger" type="Area2D" parent="."]
script = ExtResource( 48 )
EnterType = 3

[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="StoneAudioTrigger"]
polygon = PoolVector2Array( 368, 329, 346, 327, 346, 310, 321, 310, 298, 313, 285, 328, 220, 326, 203, 295, 169, 268, 137, 264, 122, 254, 123, 234, 169, 238, 189, 250, 220, 253, 252, 245, 303, 245, 346, 244, 429, 244, 432, 309, 407, 327 )

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StoneAudioTrigger"]
polygon = PoolVector2Array( 581, 377, 580, 367, 570, 361, 573, 349, 574, 341, 592, 339, 611, 341, 626, 327, 626, 294, 623, 270, 606, 261, 605, 234, 628, 232, 644, 234, 640, 391, 581, 390 )

[node name="CollisionPolygon2D3" type="CollisionPolygon2D" parent="StoneAudioTrigger"]
polygon = PoolVector2Array( 33, 345, 68, 346, 68, 371, 33, 381 )

[connection signal="area_entered" from="Collisions/OpenMapZone" to="Notebook" method="_on_OpenMapZone_area_entered"]
[connection signal="area_entered" from="Collisions/IntroAreaDoor" to="YSort/Player" method="_on_IntroAreaDoor_area_entered"]
[connection signal="area_entered" from="Collisions/HotelDeVilleDoor/OpenEndDoor/EnterEndZone" to="YSort/Player" method="_on_EnterEndZone_area_entered"]
Expand Down

0 comments on commit d69a09c

Please sign in to comment.