Un peu de musique dans ce monde de brutes
This commit is contained in:
@@ -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")
|
||||
|
||||
BIN
caracters/musicians/Subway_Busker_2_48x48.png
Normal file
BIN
caracters/musicians/Subway_Busker_2_48x48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
34
caracters/musicians/Subway_Busker_2_48x48.png.import
Normal file
34
caracters/musicians/Subway_Busker_2_48x48.png.import
Normal 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
|
||||
74
caracters/musicians/Tho7203.tmp
Normal file
74
caracters/musicians/Tho7203.tmp
Normal 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"]
|
||||
74
caracters/musicians/Thomas.tscn
Normal file
74
caracters/musicians/Thomas.tscn
Normal 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"]
|
||||
67
caracters/musicians/mike.tscn
Normal file
67
caracters/musicians/mike.tscn
Normal 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
|
||||
33
caracters/musicians/thomas.gd
Normal file
33
caracters/musicians/thomas.gd
Normal 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")
|
||||
@@ -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"]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user