Un peu de musique dans ce monde de brutes

This commit is contained in:
Thomas
2025-03-31 13:13:07 +02:00
parent a82237ff28
commit b091bb96db
46 changed files with 702 additions and 6 deletions

View File

@@ -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=""

View File

@@ -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"]

Binary file not shown.

View File

@@ -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

Binary file not shown.

View File

@@ -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

BIN
assest/fx/engine-6000.mp3 Normal file

Binary file not shown.

View File

@@ -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

BIN
assest/fx/engine-6000.ogg Normal file

Binary file not shown.

View File

@@ -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

Binary file not shown.

View File

@@ -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

Binary file not shown.

View File

@@ -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

View File

@@ -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

BIN
assest/music/chaussette.ogg Normal file

Binary file not shown.

View File

@@ -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

Binary file not shown.

View File

@@ -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

View File

@@ -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

BIN
assest/music/sunrise.ogg Normal file

Binary file not shown.

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -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

View File

@@ -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")

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -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

View File

@@ -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"]

View File

@@ -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"]

View File

@@ -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

View File

@@ -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")

View File

@@ -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"]

View File

@@ -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)

View File

@@ -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)

View File

@@ -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")

View File

@@ -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()

View File

@@ -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")

View File

@@ -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"]

View File

@@ -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)

View File

@@ -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"]