diff --git a/scenes/dialogue.tscn b/scenes/dialogue.tscn index 4185645..3aed838 100644 --- a/scenes/dialogue.tscn +++ b/scenes/dialogue.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://images/ui/dialogue_bg.png" type="Texture" id=1] [ext_resource path="res://fonts/dialog_default_font.tres" type="DynamicFont" id=2] @@ -8,6 +8,8 @@ [ext_resource path="res://BlackScreen.tscn" type="PackedScene" id=6] [ext_resource path="res://scripts/BlackScreen.gd" type="Script" id=7] [ext_resource path="res://scripts/ControlIndicator.gd" type="Script" id=8] +[ext_resource path="res://sounds/gibberish.wav" type="AudioStream" id=9] +[ext_resource path="res://sounds/gibberish2.wav" type="AudioStream" id=10] [sub_resource type="VisualShaderNodeColorConstant" id=1] constant = Color( 0, 0, 0, 0.803922 ) @@ -212,3 +214,9 @@ fit_content_height = true __meta__ = { "_edit_use_anchors_": false } + +[node name="GibberishPlayer1" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 9 ) + +[node name="GibberishPlayer2" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 10 ) diff --git a/scripts/DialogueBox.gd b/scripts/DialogueBox.gd index b25b4e1..ac4aa4b 100644 --- a/scripts/DialogueBox.gd +++ b/scripts/DialogueBox.gd @@ -133,7 +133,15 @@ func animate_text(): if text_label.text[text_label.visible_characters] == ' ': text_label.visible_characters += 1 text_label.visible_characters += 1 - yield(get_tree().create_timer(0.4 if text_label.text[text_label.visible_characters - 1] == '.' else 0.05), 'timeout') + + var c = text_label.text[text_label.visible_characters - 1] + + if $MarginContainer.visible: + if "abcdefghijklmnoprstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZÀàéÉçÇÈèùÙ.".rfind(c) >= 0: + if character_name == 'Ely': $GibberishPlayer2.play() + else: $GibberishPlayer1.play() + + yield(get_tree().create_timer(0.4 if c == '.' else 0.05), 'timeout') if !Globals.ui_accept_tip: control_indicator.show_press('ui_accept') Globals.ui_accept_tip = true diff --git a/scripts/scenes/IntroScript.gd b/scripts/scenes/IntroScript.gd index 1ba8a66..08070d3 100644 --- a/scripts/scenes/IntroScript.gd +++ b/scripts/scenes/IntroScript.gd @@ -18,7 +18,6 @@ func _ready(): dialogue_box.connect('update', self, 'update_camera') - yield(get_tree().create_timer(2.0), 'timeout') yield(dialogue_box.start_dialogue(intro_dialogue), 'end') get_tree().change_scene("res://scenes/game1.tscn") diff --git a/sounds/BRS_Fire_Campfire_Busy_Crackles_Snaps_1.wav.import b/sounds/BRS_Fire_Campfire_Busy_Crackles_Snaps_1.wav.import index 15d3b2d..ec6c8ac 100644 --- a/sounds/BRS_Fire_Campfire_Busy_Crackles_Snaps_1.wav.import +++ b/sounds/BRS_Fire_Campfire_Busy_Crackles_Snaps_1.wav.import @@ -17,5 +17,5 @@ force/max_rate=false force/max_rate_hz=44100 edit/trim=false edit/normalize=false -edit/loop=false +edit/loop=true compress/mode=0 diff --git a/sounds/gibberish.wav b/sounds/gibberish.wav new file mode 100644 index 0000000..f08b053 Binary files /dev/null and b/sounds/gibberish.wav differ diff --git a/sounds/gibberish.wav.import b/sounds/gibberish.wav.import new file mode 100644 index 0000000..e99e170 --- /dev/null +++ b/sounds/gibberish.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/gibberish.wav-d9ccae3969716aecb07896cc5967f4f1.sample" + +[deps] + +source_file="res://sounds/gibberish.wav" +dest_files=[ "res://.import/gibberish.wav-d9ccae3969716aecb07896cc5967f4f1.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=false +compress/mode=0 diff --git a/sounds/gibberish2.wav b/sounds/gibberish2.wav new file mode 100644 index 0000000..052453d Binary files /dev/null and b/sounds/gibberish2.wav differ diff --git a/sounds/gibberish2.wav.import b/sounds/gibberish2.wav.import new file mode 100644 index 0000000..322c45f --- /dev/null +++ b/sounds/gibberish2.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/gibberish2.wav-6ec18f6f246c055727b749c364482200.sample" + +[deps] + +source_file="res://sounds/gibberish2.wav" +dest_files=[ "res://.import/gibberish2.wav-6ec18f6f246c055727b749c364482200.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=false +compress/mode=0