diff --git a/UI/menu.gd b/UI/menu.gd index 982850d..1d183e2 100644 --- a/UI/menu.gd +++ b/UI/menu.gd @@ -26,6 +26,7 @@ func set_last_save_info(): func _ready() -> void: set_last_save_info() + $AudioStreamPlayer.play() func _on_button_pressed() -> void: emit_signal("start") @@ -43,6 +44,5 @@ func _on_load_pressed() -> void: emit_signal("load") _on_button_pressed() - func _on_timer_timeout() -> void: $MarginContainer/Panel/VBoxContainer/info.text="" diff --git a/UI/menu.tscn b/UI/menu.tscn index 6045b69..a904adf 100644 --- a/UI/menu.tscn +++ b/UI/menu.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://44wla7mlivqm"] +[gd_scene load_steps=8 format=3 uid="uid://44wla7mlivqm"] [ext_resource type="Script" path="res://UI/menu.gd" id="1_30mo7"] [ext_resource type="FontFile" uid="uid://c1lnxul6k2adw" path="res://assest/font/vhs-gothic.ttf" id="2_6inip"] [ext_resource type="Theme" uid="uid://bn1flbuijm27d" path="res://UI/menu_button.tres" id="3_feq31"] +[ext_resource type="AudioStream" uid="uid://dcp8rqog22cbk" path="res://assest/music/chaussette.ogg" id="4_0n4j1"] [sub_resource type="LabelSettings" id="LabelSettings_q3w7i"] line_spacing = 45.0 @@ -86,6 +87,11 @@ vertical_alignment = 3 wait_time = 5.0 one_shot = true +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("4_0n4j1") +volume_db = -14.596 +autoplay = true + [connection signal="pressed" from="MarginContainer/Panel/VBoxContainer/Start" to="." method="_on_button_pressed"] [connection signal="pressed" from="MarginContainer/Panel/VBoxContainer/Load" to="." method="_on_load_pressed"] [connection signal="pressed" from="MarginContainer/Panel/VBoxContainer/Save" to="." method="_on_save_pressed"] diff --git a/assest/fx/Car Engine Run Loop 01.wav b/assest/fx/Car Engine Run Loop 01.wav new file mode 100644 index 0000000..7d95f3a Binary files /dev/null and b/assest/fx/Car Engine Run Loop 01.wav differ diff --git a/assest/fx/Car Engine Run Loop 01.wav.import b/assest/fx/Car Engine Run Loop 01.wav.import new file mode 100644 index 0000000..7dd7caa --- /dev/null +++ b/assest/fx/Car Engine Run Loop 01.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dss57dxv3a27n" +path="res://.godot/imported/Car Engine Run Loop 01.wav-2524f1b20d378e414bce1f16b3a68520.sample" + +[deps] + +source_file="res://assest/fx/Car Engine Run Loop 01.wav" +dest_files=["res://.godot/imported/Car Engine Run Loop 01.wav-2524f1b20d378e414bce1f16b3a68520.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=0 diff --git a/assest/fx/Car Engine Run Loop 02.wav b/assest/fx/Car Engine Run Loop 02.wav new file mode 100644 index 0000000..a45134c Binary files /dev/null and b/assest/fx/Car Engine Run Loop 02.wav differ diff --git a/assest/fx/Car Engine Run Loop 02.wav.import b/assest/fx/Car Engine Run Loop 02.wav.import new file mode 100644 index 0000000..a1e198c --- /dev/null +++ b/assest/fx/Car Engine Run Loop 02.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cy6kiqkfpujl4" +path="res://.godot/imported/Car Engine Run Loop 02.wav-f926be39e4c12635d6b6095bbaf52c57.sample" + +[deps] + +source_file="res://assest/fx/Car Engine Run Loop 02.wav" +dest_files=["res://.godot/imported/Car Engine Run Loop 02.wav-f926be39e4c12635d6b6095bbaf52c57.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=0 diff --git a/assest/fx/engine-6000.mp3 b/assest/fx/engine-6000.mp3 new file mode 100644 index 0000000..1f0d02d Binary files /dev/null and b/assest/fx/engine-6000.mp3 differ diff --git a/assest/fx/engine-6000.mp3.import b/assest/fx/engine-6000.mp3.import new file mode 100644 index 0000000..819a261 --- /dev/null +++ b/assest/fx/engine-6000.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://br2iyrmjgoqix" +path="res://.godot/imported/engine-6000.mp3-fbda7b044616a16267c6c7a0d2e57cb9.mp3str" + +[deps] + +source_file="res://assest/fx/engine-6000.mp3" +dest_files=["res://.godot/imported/engine-6000.mp3-fbda7b044616a16267c6c7a0d2e57cb9.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assest/fx/engine-6000.ogg b/assest/fx/engine-6000.ogg new file mode 100644 index 0000000..5a67c54 Binary files /dev/null and b/assest/fx/engine-6000.ogg differ diff --git a/assest/fx/engine-6000.ogg.import b/assest/fx/engine-6000.ogg.import new file mode 100644 index 0000000..8cb3beb --- /dev/null +++ b/assest/fx/engine-6000.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://c774hcxk657n" +path="res://.godot/imported/engine-6000.ogg-2371dd05e2bbf15dbe1a731441242313.oggvorbisstr" + +[deps] + +source_file="res://assest/fx/engine-6000.ogg" +dest_files=["res://.godot/imported/engine-6000.ogg-2371dd05e2bbf15dbe1a731441242313.oggvorbisstr"] + +[params] + +loop=true +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/assest/music/balade du grand nord.ogg b/assest/music/balade du grand nord.ogg new file mode 100644 index 0000000..0f88804 Binary files /dev/null and b/assest/music/balade du grand nord.ogg differ diff --git a/assest/music/balade du grand nord.ogg.import b/assest/music/balade du grand nord.ogg.import new file mode 100644 index 0000000..0de3ebc --- /dev/null +++ b/assest/music/balade du grand nord.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bdj7nbrv8f53m" +path="res://.godot/imported/balade du grand nord.ogg-fd2ed11b9c5abe6f48a4378942d5d87c.oggvorbisstr" + +[deps] + +source_file="res://assest/music/balade du grand nord.ogg" +dest_files=["res://.godot/imported/balade du grand nord.ogg-fd2ed11b9c5abe6f48a4378942d5d87c.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assest/music/chartreuse blues.ogg b/assest/music/chartreuse blues.ogg new file mode 100644 index 0000000..f45d12b Binary files /dev/null and b/assest/music/chartreuse blues.ogg differ diff --git a/assest/music/chartreuse blues.ogg.import b/assest/music/chartreuse blues.ogg.import new file mode 100644 index 0000000..01ee45c --- /dev/null +++ b/assest/music/chartreuse blues.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bpm1d70babypo" +path="res://.godot/imported/chartreuse blues.ogg-ad993b8b827a57d114ee2d2e19b6a842.oggvorbisstr" + +[deps] + +source_file="res://assest/music/chartreuse blues.ogg" +dest_files=["res://.godot/imported/chartreuse blues.ogg-ad993b8b827a57d114ee2d2e19b6a842.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assest/music/chartreuse blues.wav.import b/assest/music/chartreuse blues.wav.import new file mode 100644 index 0000000..2cd5f96 --- /dev/null +++ b/assest/music/chartreuse blues.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://ch4gtmcokr6bi" +path="res://.godot/imported/chartreuse blues.wav-86e43b1383a61dd92880b71b53d86d70.sample" + +[deps] + +source_file="res://assest/music/chartreuse blues.wav" +dest_files=["res://.godot/imported/chartreuse blues.wav-86e43b1383a61dd92880b71b53d86d70.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=0 diff --git a/assest/music/chaussette.ogg b/assest/music/chaussette.ogg new file mode 100644 index 0000000..f9236ad Binary files /dev/null and b/assest/music/chaussette.ogg differ diff --git a/assest/music/chaussette.ogg.import b/assest/music/chaussette.ogg.import new file mode 100644 index 0000000..fea3316 --- /dev/null +++ b/assest/music/chaussette.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dcp8rqog22cbk" +path="res://.godot/imported/chaussette.ogg-8b3f6e8aa6b419ba0bcbd848c0f0d50e.oggvorbisstr" + +[deps] + +source_file="res://assest/music/chaussette.ogg" +dest_files=["res://.godot/imported/chaussette.ogg-8b3f6e8aa6b419ba0bcbd848c0f0d50e.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assest/music/latino_accords_et_impro.ogg b/assest/music/latino_accords_et_impro.ogg new file mode 100644 index 0000000..322829d Binary files /dev/null and b/assest/music/latino_accords_et_impro.ogg differ diff --git a/assest/music/latino_accords_et_impro.ogg.import b/assest/music/latino_accords_et_impro.ogg.import new file mode 100644 index 0000000..7c8887d --- /dev/null +++ b/assest/music/latino_accords_et_impro.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://h6sai6wl5hfe" +path="res://.godot/imported/latino_accords_et_impro.ogg-2aa2055f0e514a7d61541965f4b0df87.oggvorbisstr" + +[deps] + +source_file="res://assest/music/latino_accords_et_impro.ogg" +dest_files=["res://.godot/imported/latino_accords_et_impro.ogg-2aa2055f0e514a7d61541965f4b0df87.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assest/music/latino_accords_et_impro.wav.import b/assest/music/latino_accords_et_impro.wav.import new file mode 100644 index 0000000..053e926 --- /dev/null +++ b/assest/music/latino_accords_et_impro.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bbkyhh3b2xtdj" +path="res://.godot/imported/latino_accords_et_impro.wav-a3852d1dcd4267496d6b1fed96b0f725.sample" + +[deps] + +source_file="res://assest/music/latino_accords_et_impro.wav" +dest_files=["res://.godot/imported/latino_accords_et_impro.wav-a3852d1dcd4267496d6b1fed96b0f725.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=0 diff --git a/assest/music/sunrise.ogg b/assest/music/sunrise.ogg new file mode 100644 index 0000000..86b3eda Binary files /dev/null and b/assest/music/sunrise.ogg differ diff --git a/assest/music/sunrise.ogg.import b/assest/music/sunrise.ogg.import new file mode 100644 index 0000000..b415727 --- /dev/null +++ b/assest/music/sunrise.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://e0qws1j41ojk" +path="res://.godot/imported/sunrise.ogg-93fddad891f86f9eb01c058e7bc01416.oggvorbisstr" + +[deps] + +source_file="res://assest/music/sunrise.ogg" +dest_files=["res://.godot/imported/sunrise.ogg-93fddad891f86f9eb01c058e7bc01416.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assest/musicians/Subway_Busker_1_48x48.png b/assest/musicians/Subway_Busker_1_48x48.png new file mode 100644 index 0000000..25be4df Binary files /dev/null and b/assest/musicians/Subway_Busker_1_48x48.png differ diff --git a/assest/musicians/Subway_Busker_1_48x48.png.import b/assest/musicians/Subway_Busker_1_48x48.png.import new file mode 100644 index 0000000..3ffbf2f --- /dev/null +++ b/assest/musicians/Subway_Busker_1_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2ia0h20isonk" +path="res://.godot/imported/Subway_Busker_1_48x48.png-1b4b76937b09dd37c5a13193ebdab140.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assest/musicians/Subway_Busker_1_48x48.png" +dest_files=["res://.godot/imported/Subway_Busker_1_48x48.png-1b4b76937b09dd37c5a13193ebdab140.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assest/musicians/Subway_Busker_2_48x48.png b/assest/musicians/Subway_Busker_2_48x48.png new file mode 100644 index 0000000..f8a64e4 Binary files /dev/null and b/assest/musicians/Subway_Busker_2_48x48.png differ diff --git a/assest/musicians/Subway_Busker_2_48x48.png.import b/assest/musicians/Subway_Busker_2_48x48.png.import new file mode 100644 index 0000000..35613c2 --- /dev/null +++ b/assest/musicians/Subway_Busker_2_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0yybe0v6bkv1" +path="res://.godot/imported/Subway_Busker_2_48x48.png-cbf3890edf01c500cf72d2e114807d67.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assest/musicians/Subway_Busker_2_48x48.png" +dest_files=["res://.godot/imported/Subway_Busker_2_48x48.png-cbf3890edf01c500cf72d2e114807d67.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assest/musicians/Subway_Busker_3_48x48.png b/assest/musicians/Subway_Busker_3_48x48.png new file mode 100644 index 0000000..763b112 Binary files /dev/null and b/assest/musicians/Subway_Busker_3_48x48.png differ diff --git a/assest/musicians/Subway_Busker_3_48x48.png.import b/assest/musicians/Subway_Busker_3_48x48.png.import new file mode 100644 index 0000000..cf5ecde --- /dev/null +++ b/assest/musicians/Subway_Busker_3_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cfvjok4bqwv0s" +path="res://.godot/imported/Subway_Busker_3_48x48.png-e62bf79ad703e5b89c8086b6def1df69.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assest/musicians/Subway_Busker_3_48x48.png" +dest_files=["res://.godot/imported/Subway_Busker_3_48x48.png-e62bf79ad703e5b89c8086b6def1df69.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assest/musicians/Subway_Busker_4_48x48.png b/assest/musicians/Subway_Busker_4_48x48.png new file mode 100644 index 0000000..2c12902 Binary files /dev/null and b/assest/musicians/Subway_Busker_4_48x48.png differ diff --git a/assest/musicians/Subway_Busker_4_48x48.png.import b/assest/musicians/Subway_Busker_4_48x48.png.import new file mode 100644 index 0000000..e0e3aa8 --- /dev/null +++ b/assest/musicians/Subway_Busker_4_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cdgnqws4vmnhx" +path="res://.godot/imported/Subway_Busker_4_48x48.png-0a88e42f3841e4228f57177753d58423.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assest/musicians/Subway_Busker_4_48x48.png" +dest_files=["res://.godot/imported/Subway_Busker_4_48x48.png-0a88e42f3841e4228f57177753d58423.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/caracters/human.gd b/caracters/human.gd index 53eecda..b8a61ec 100644 --- a/caracters/human.gd +++ b/caracters/human.gd @@ -18,6 +18,7 @@ var interactionPaused= false var kill_path_finder = false signal start_intracting +signal loadFromGameState var last_facing_direction = Vector2(0,1) # facing south var velocityVector = Vector2(0, 0) @@ -104,3 +105,7 @@ func disable_interaction_clue(): interactionClueFor = null interactionPaused = false pause_or_stop_interaction_clue() + + +func _on_load_from_game_state() -> void: + emit_signal("loadFromGameState") diff --git a/caracters/musicians/Subway_Busker_2_48x48.png b/caracters/musicians/Subway_Busker_2_48x48.png new file mode 100644 index 0000000..f8a64e4 Binary files /dev/null and b/caracters/musicians/Subway_Busker_2_48x48.png differ diff --git a/caracters/musicians/Subway_Busker_2_48x48.png.import b/caracters/musicians/Subway_Busker_2_48x48.png.import new file mode 100644 index 0000000..233d97b --- /dev/null +++ b/caracters/musicians/Subway_Busker_2_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bmx3xo32vwnrb" +path="res://.godot/imported/Subway_Busker_2_48x48.png-a23771ca7e17f5b13bb6cffb0663e623.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://caracters/musicians/Subway_Busker_2_48x48.png" +dest_files=["res://.godot/imported/Subway_Busker_2_48x48.png-a23771ca7e17f5b13bb6cffb0663e623.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/caracters/musicians/Tho7203.tmp b/caracters/musicians/Tho7203.tmp new file mode 100644 index 0000000..e62aecb --- /dev/null +++ b/caracters/musicians/Tho7203.tmp @@ -0,0 +1,74 @@ +[gd_scene load_steps=8 format=3 uid="uid://bh636kqo4rhy3"] + +[ext_resource type="Texture2D" uid="uid://0yybe0v6bkv1" path="res://assest/musicians/Subway_Busker_2_48x48.png" id="1_dq5dt"] +[ext_resource type="Script" path="res://caracters/musicians/thomas.gd" id="1_it5tv"] +[ext_resource type="AudioStream" uid="uid://bdj7nbrv8f53m" path="res://assest/music/balade du grand nord.ogg" id="2_6pcth"] + +[sub_resource type="Animation" id="Animation_k8n4u"] +resource_name = "play" +length = 1.3 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 6, 7, 6, 7, 8, 9, 10, 11] +} + +[sub_resource type="Animation" id="Animation_2qywv"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_v18ad"] +_data = { +"RESET": SubResource("Animation_2qywv"), +"play": SubResource("Animation_k8n4u") +} + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_0816g"] +radius = 6.0 +height = 66.0 + +[node name="Thomas" type="StaticBody2D"] +script = ExtResource("1_it5tv") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_dq5dt") +hframes = 12 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_v18ad") +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(5, 33) +rotation = 1.5708 +shape = SubResource("CapsuleShape2D_0816g") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("2_6pcth") +volume_db = 1.0 +autoplay = true +max_distance = 1000.0 +attenuation = 2.0 +parameters/looping = false + +[connection signal="finished" from="AudioStreamPlayer2D" to="." method="_on_audio_stream_player_2d_finished"] diff --git a/caracters/musicians/Thomas.tscn b/caracters/musicians/Thomas.tscn new file mode 100644 index 0000000..e62aecb --- /dev/null +++ b/caracters/musicians/Thomas.tscn @@ -0,0 +1,74 @@ +[gd_scene load_steps=8 format=3 uid="uid://bh636kqo4rhy3"] + +[ext_resource type="Texture2D" uid="uid://0yybe0v6bkv1" path="res://assest/musicians/Subway_Busker_2_48x48.png" id="1_dq5dt"] +[ext_resource type="Script" path="res://caracters/musicians/thomas.gd" id="1_it5tv"] +[ext_resource type="AudioStream" uid="uid://bdj7nbrv8f53m" path="res://assest/music/balade du grand nord.ogg" id="2_6pcth"] + +[sub_resource type="Animation" id="Animation_k8n4u"] +resource_name = "play" +length = 1.3 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 6, 7, 6, 7, 8, 9, 10, 11] +} + +[sub_resource type="Animation" id="Animation_2qywv"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_v18ad"] +_data = { +"RESET": SubResource("Animation_2qywv"), +"play": SubResource("Animation_k8n4u") +} + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_0816g"] +radius = 6.0 +height = 66.0 + +[node name="Thomas" type="StaticBody2D"] +script = ExtResource("1_it5tv") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_dq5dt") +hframes = 12 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_v18ad") +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(5, 33) +rotation = 1.5708 +shape = SubResource("CapsuleShape2D_0816g") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("2_6pcth") +volume_db = 1.0 +autoplay = true +max_distance = 1000.0 +attenuation = 2.0 +parameters/looping = false + +[connection signal="finished" from="AudioStreamPlayer2D" to="." method="_on_audio_stream_player_2d_finished"] diff --git a/caracters/musicians/mike.tscn b/caracters/musicians/mike.tscn new file mode 100644 index 0000000..36b5b46 --- /dev/null +++ b/caracters/musicians/mike.tscn @@ -0,0 +1,67 @@ +[gd_scene load_steps=7 format=3 uid="uid://cjxpn0cukd6vo"] + +[ext_resource type="Script" path="res://caracters/musicians/thomas.gd" id="1_up6tq"] +[ext_resource type="Texture2D" uid="uid://d2ia0h20isonk" path="res://assest/musicians/Subway_Busker_1_48x48.png" id="2_bb48o"] + +[sub_resource type="Animation" id="Animation_2qywv"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + +[sub_resource type="Animation" id="Animation_k8n4u"] +resource_name = "play" +length = 1.3 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 6, 7, 6, 7, 8, 9, 10, 11] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_v18ad"] +_data = { +"RESET": SubResource("Animation_2qywv"), +"play": SubResource("Animation_k8n4u") +} + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_0816g"] +radius = 6.0 +height = 66.0 + +[node name="Thomas" type="StaticBody2D"] +script = ExtResource("1_up6tq") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_bb48o") +hframes = 12 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_v18ad") +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(5, 33) +rotation = 1.5708 +shape = SubResource("CapsuleShape2D_0816g") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +volume_db = 1.0 +autoplay = true diff --git a/caracters/musicians/thomas.gd b/caracters/musicians/thomas.gd new file mode 100644 index 0000000..40ce14a --- /dev/null +++ b/caracters/musicians/thomas.gd @@ -0,0 +1,33 @@ +extends StaticBody2D + +var songs = [ + "res://assest/music/chartreuse blues.ogg", + "res://assest/music/latino_accords_et_impro.ogg", + "res://assest/music/balade du grand nord.ogg", +] + +var current_song = -1 + +func _ready() -> void: + $AnimationPlayer.play("play") + +func _process(delta: float) -> void: + if $AudioStreamPlayer2D.get_playback_position() != 0: + GameState.float_thomas_music_position = $AudioStreamPlayer2D.get_playback_position() + +func _on_load_from_game_state() -> void: + $AudioStreamPlayer2D.play(GameState.float_thomas_music_position) + +func _on_audio_stream_player_2d_finished() -> void: + play_next_song() + +func play_next_song(): + $AudioStreamPlayer2D.stop() + current_song += 1 + if current_song == songs.size(): + current_song = 0 + print("play ", songs[current_song]) + $AudioStreamPlayer2D.stream= load(songs[current_song]); + GameState.float_thomas_music_position = 0 + $AudioStreamPlayer2D.play(GameState.float_thomas_music_position) + $AnimationPlayer.play("play") diff --git a/caracters/player/player.tscn b/caracters/player/player.tscn index c2de7ac..9681db9 100644 --- a/caracters/player/player.tscn +++ b/caracters/player/player.tscn @@ -35,6 +35,8 @@ script = ExtResource("1_l1sti") metadata/_edit_vertical_guides_ = [-20.0] metadata/_edit_horizontal_guides_ = [48.0] +[node name="AudioListener2D" type="AudioListener2D" parent="."] + [node name="Camera2D" type="Camera2D" parent="."] zoom = Vector2(1.5, 1.5) position_smoothing_enabled = true @@ -93,6 +95,7 @@ collide_with_bodies = false [node name="PathFinder" parent="." instance=ExtResource("7_g6pgs")] can_walk_on_roads = true +[connection signal="loadFromGameState" from="." to="controleur" method="_on_character_body_2d_load_from_game_state"] [connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"] [connection signal="area_entered" from="Area2D" to="controleur" method="_on_declencheur"] [connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"] diff --git a/caracters/player/player_controler.gd b/caracters/player/player_controler.gd index 40f97bd..1306057 100644 --- a/caracters/player/player_controler.gd +++ b/caracters/player/player_controler.gd @@ -97,3 +97,6 @@ func _on_area_2d_body_entered(body: Node2D) -> void: func _on_area_2d_body_exited(body: Node2D) -> void: pass + +func _on_character_body_2d_load_from_game_state() -> void: + human.set_feet_global_position(GameState.position_outside) diff --git a/game_state.gd b/game_state.gd index 8029c5e..4bdeb18 100644 --- a/game_state.gd +++ b/game_state.gd @@ -9,6 +9,9 @@ var hasMetBob = false var hasVisitedBakery = false var isPlayerDeaf = false + +var float_thomas_music_position = 5 + var current_scene = "outside" var position_outside = Vector2(-171, -253) var position_bakery = Vector2(461, 710) diff --git a/scenes/bakery.gd b/scenes/bakery.gd index ed91776..5f1409f 100644 --- a/scenes/bakery.gd +++ b/scenes/bakery.gd @@ -1,5 +1,6 @@ extends Node2D +signal loadFromGameState # Called when the node enters the scene tree for the first time. func _ready() -> void: @@ -7,3 +8,4 @@ func _ready() -> void: func load_from_game_state(): $Bakery/player.set_feet_global_position(GameState.position_bakery) + emit_signal("loadFromGameState") diff --git a/scenes/game.gd b/scenes/game.gd index 305bceb..ba4a206 100644 --- a/scenes/game.gd +++ b/scenes/game.gd @@ -52,6 +52,6 @@ func load_game(): func save_game(): var save_file = FileAccess.open("user://savegame.save", FileAccess.WRITE) - save_file.store_line(JSON.stringify(GameState.save())) + save_file.store_line(JSON.stringify(GameState.save(), " ", true, true)) print(OS.get_data_dir()) save_file.close() diff --git a/scenes/outside.gd b/scenes/outside.gd index 3ddfbe0..94c1f2b 100644 --- a/scenes/outside.gd +++ b/scenes/outside.gd @@ -1,9 +1,10 @@ extends Node2D +signal loadFromGameState # Called when the node enters the scene tree for the first time. func _ready() -> void: load_from_game_state() func load_from_game_state(): - $world/player.set_feet_global_position(GameState.position_outside) + emit_signal("loadFromGameState") diff --git a/scenes/outside.tscn b/scenes/outside.tscn index 30bb773..8d9cb6d 100644 --- a/scenes/outside.tscn +++ b/scenes/outside.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://b4ydi1vv8dvwr"] +[gd_scene load_steps=11 format=3 uid="uid://b4ydi1vv8dvwr"] [ext_resource type="Script" path="res://scenes/outside.gd" id="1_wyh83"] [ext_resource type="PackedScene" uid="uid://d1oqt6sbjvopi" path="res://maps/map.tscn" id="1_ysg4m"] @@ -6,6 +6,8 @@ [ext_resource type="PackedScene" uid="uid://vclpg4e4ql54" path="res://caracters/player/player.tscn" id="3_bt1tp"] [ext_resource type="PackedScene" uid="uid://cl201baro5y5" path="res://vehicules/npc_car.tscn" id="4_dt4vq"] [ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/car.tscn" id="5_4nlh0"] +[ext_resource type="PackedScene" uid="uid://bh636kqo4rhy3" path="res://caracters/musicians/Thomas.tscn" id="7_7urlf"] +[ext_resource type="PackedScene" uid="uid://cjxpn0cukd6vo" path="res://caracters/musicians/mike.tscn" id="8_eenai"] [sub_resource type="Curve2D" id="Curve2D_shblg"] _data = { @@ -60,3 +62,14 @@ world = NodePath("../../../../world") [node name="Car" parent="movibles/cars/Path2D2" instance=ExtResource("5_4nlh0")] position = Vector2(790, 1372) speed = 500 + +[node name="Thomas" parent="." instance=ExtResource("7_7urlf")] +z_index = 2001 +position = Vector2(-199, -484) + +[node name="Thomas2" parent="." instance=ExtResource("8_eenai")] +z_index = 2001 +position = Vector2(-142, -510) + +[connection signal="loadFromGameState" from="." to="world/player" method="_on_load_from_game_state"] +[connection signal="loadFromGameState" from="." to="Thomas" method="_on_load_from_game_state"] diff --git a/vehicules/car.gd b/vehicules/car.gd index b90dff1..f393f57 100644 --- a/vehicules/car.gd +++ b/vehicules/car.gd @@ -23,9 +23,13 @@ func moveTo(position: Vector2) -> void: func updateFacingDirectionInAnimationTree(): animation_tree.set("parameters/CarStates/driving/blend_position", last_facing_direction) animation_tree.set("parameters/CarStates/idling/blend_position", last_facing_direction) + +func _ready() -> void: + $AudioStreamPlayer2D.play() # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: + $AudioStreamPlayer2D.pitch_scale = current_speed / speed $ZIndexControler/ShapeCast2D.enabled = !$CollisionHorizontal.disabled var accelerationStep = (speed * delta / timeToChangeVelocity) diff --git a/vehicules/car.tscn b/vehicules/car.tscn index acb6e7e..323b460 100644 --- a/vehicules/car.tscn +++ b/vehicules/car.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=35 format=3 uid="uid://bt1p311rn1h6q"] +[gd_scene load_steps=36 format=3 uid="uid://bt1p311rn1h6q"] [ext_resource type="Script" path="res://vehicules/car.gd" id="1_vkq5y"] [ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="3_iaqxo"] [ext_resource type="Texture2D" uid="uid://dq81e78eaild8" path="res://assest/vehicules/Car_classic_red_48x48.png" id="4_0kman"] +[ext_resource type="AudioStream" uid="uid://c774hcxk657n" path="res://assest/fx/engine-6000.ogg" id="4_o8ske"] [sub_resource type="Animation" id="Animation_24r8n"] length = 0.001 @@ -602,3 +603,11 @@ offset_bottom = -19.0 position = Vector2(1, -13) shape = SubResource("RectangleShape2D_yiphh") target_position = Vector2(1, -32) + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("4_o8ske") +volume_db = -20.8 +autoplay = true +attenuation = 2.0 + +[connection signal="finished" from="AudioStreamPlayer2D" to="." method="_on_audio_stream_player_2d_finished"]