modification de la scène de cockpit et ajout de lien entre les scènes

This commit is contained in:
2026-02-19 22:15:38 +01:00
parent fadf0cb769
commit dc1a6686bc
130 changed files with 4131 additions and 1286 deletions

View File

@@ -6,7 +6,7 @@
[ext_resource type="AudioStream" uid="uid://bqwiaek5b5q00" path="res://common/audio_manager/assets/morceaux/niveau/forest_phase_2.ogg" id="6_ldyhq"]
[ext_resource type="AudioStream" uid="uid://d4lqhgf0lhgge" path="res://common/audio_manager/assets/morceaux/niveau/forest_phase_3.ogg" id="7_ol34x"]
[ext_resource type="AudioStream" uid="uid://bpf6witukorka" path="res://common/audio_manager/assets/morceaux/autres/main_menu.ogg" id="7_tuvql"]
[ext_resource type="AudioStream" uid="uid://brtjlgjqnrvcb" path="res://common/audio_manager/assets/morceaux/autres/truck_music.ogg" id="8_0e5ja"]
[ext_resource type="AudioStream" uid="uid://dadg6o6dl2k6t" path="res://common/audio_manager/assets/morceaux/autres/truck_music.ogg" id="8_0e5ja"]
[ext_resource type="AudioStream" uid="uid://bnxsnege8qq6e" path="res://common/audio_manager/assets/morceaux/niveau/forest_phase_4.ogg" id="8_ajci6"]
[ext_resource type="AudioStream" uid="uid://dfrp66a4isnt6" path="res://common/audio_manager/assets/sfx/dig/dig_1.wav" id="9_gv65y"]
[ext_resource type="AudioStream" uid="uid://bdxkvaciw4mb3" path="res://common/audio_manager/assets/sfx/dig/dig_2.wav" id="10_n7o7n"]
@@ -59,7 +59,6 @@ stream_1/stream = ExtResource("21_dk5s6")
[node name="AudioManager" type="Node" unique_id=1871137180]
process_mode = 3
script = ExtResource("1_0tvca")
default_fade_time = 2.0
[node name="Ambiance" type="Node" parent="." unique_id=1989991562]
unique_name_in_owner = true
@@ -78,6 +77,7 @@ stream = SubResource("AudioStreamPlaylist_ajci6")
[node name="Title" type="AudioStreamPlayer" parent="Musics" unique_id=2105759422]
unique_name_in_owner = true
stream = ExtResource("7_tuvql")
bus = &"Music"
[node name="Truck" type="AudioStreamPlayer" parent="Musics" unique_id=1165150318]
unique_name_in_owner = true

View File

@@ -20,9 +20,9 @@ func _ready():
player.stop()
fetch_default_volumes()
setup_volume()
# setup_players_bus()
settings.sound_changed.connect(
func(_s) : setup_volume()
func(_s) : setup_players_bus()
)
SceneManager.scene_loaded.connect(_on_change_scene)
Dialogic.timeline_started.connect(_on_timeline_started)
@@ -120,21 +120,17 @@ func fetch_default_volumes():
for player in all_players:
default_volumes[player] = player.volume_db
func setup_volume():
func setup_players_bus():
for player in get_all_players():
player.volume_db = get_volume_from_parent(player)
if player.get_parent() == %Musics:
player.bus = (AudioServer.get_bus_name(SettingsData.MUSIC_BUS_ID))
elif player.get_parent() == %Sfx:
player.bus = (AudioServer.get_bus_name(SettingsData.SFX_BUS_ID))
elif player.get_parent() == %Ambiance:
player.bus = (AudioServer.get_bus_name(SettingsData.AMBIANCE_BUS_ID))
func get_volume_from_parent(player : AudioStreamPlayer) -> float:
var settings_volume = 0.5
if player.get_parent() == %Ambiance:
settings_volume = settings.ambiance_volume
elif player.get_parent() == %Sfx:
settings_volume = settings.sfx_volume
elif player.get_parent() == %Musics:
settings_volume = settings.music_volume
return default_volumes[player] + lerp(MIN_VOLUME, MAX_VOLUME, settings_volume)
func get_volume(player : AudioStreamPlayer) -> float:
return default_volumes[player]
func get_all_players() -> Array[AudioStreamPlayer]:
var players : Array[AudioStreamPlayer] = []
@@ -167,17 +163,17 @@ func start_player(player: AudioStreamPlayer, from_random_time = false, fade_time
)
if fade_time > 0.0:
player.volume_db = MIN_VOLUME
await set_volume(player, get_volume_from_parent(player), fade_time).finished
await set_volume(player, get_volume(player), fade_time).finished
func stop_player(player : AudioStreamPlayer, fade_time = DEFAULT_FADE_TIME):
if player and player.playing:
if fade_time > 0.0:
await set_volume(player, MIN_VOLUME, fade_time).finished
player.stop()
player.volume_db = get_volume_from_parent(player)
player.volume_db = get_volume(player)
func reset_volume(player : AudioStreamPlayer):
player.volume_db = get_volume_from_parent(player)
player.volume_db = get_volume(player)
func play_sfx(sfx_name : String):
var player := %Sfx.find_child(sfx_name) as AudioStreamPlayer

View File

@@ -13,6 +13,12 @@ signal current_region_data_updated(p : RegionData)
@export var last_game_scene : Scene = null
@export var ship_in_space = false
@export var tutorial_done = false
@export var dialogs_done : Array[String] = [] #Chemin des dialogues démarrés
func start_run():
player_data.inventory.clear_items()
current_run = RunData.new()
@@ -32,3 +38,17 @@ func start_region(region_param : RegionParameter):
current_region_data = RegionData.new(region_param)
current_region_data_updated.emit(current_region_data)
GameInfo.save_game_data()
func give_up():
current_region_data = null
current_run = null
func start_tutorial():
current_region_data = RegionData.new(
RegionParameter.new(
10,
3,
tr("TUTORIAL"),
true
)
)

View File

@@ -5,8 +5,8 @@ enum State {STARTED, IN_PROGRESS, FINISHED}
const RUN_POINT_POSITION_DERIVATION = 100
const DIFFICULTY_INCREASE_BY_LEVEL = 1
const RUN_POINTS_NEXT_NUMBER :Array[int] = [2,3]
const RUN_POINT_MAX_LEVEL = 10
const RUN_POINTS_NEXT_NUMBER :Array[int] = [2]
const RUN_POINT_MAX_LEVEL = 6
signal current_run_point_changed

View File

@@ -20,6 +20,7 @@ func _init(
):
level = _level
region_parameter = _region_parameter
region_parameter.level = level
position = _position
func card_info() -> CardInfo:
@@ -34,4 +35,4 @@ func card_info() -> CardInfo:
CardStatInfo.new(str(region_parameter.charges), CHARGE_ICON),
])
return info
return info

View File

@@ -1,6 +1,10 @@
extends Resource
class_name SettingsData
const MUSIC_BUS_ID = 1
const SFX_BUS_ID = 2
const AMBIANCE_BUS_ID = 3
signal language_changed(settings : SettingsData)
signal sound_changed(settings : SettingsData)
signal video_changed(settings : SettingsData)

View File

@@ -52,6 +52,10 @@ func _init():
update_video_settings()
settings_data.language_changed.connect(_on_settings_language_changed)
settings_data.video_changed.connect(_on_settings_video_changed)
settings_data.sound_changed.connect(_on_settings_sound_changed)
func _ready():
Dialogic.timeline_started.connect(_on_timeline_started)
func _on_settings_video_changed(s : SettingsData):
update_video_settings(s)
@@ -59,6 +63,17 @@ func _on_settings_video_changed(s : SettingsData):
func _on_settings_language_changed(s : SettingsData):
update_language_settings(s)
func _on_settings_sound_changed(s : SettingsData):
AudioServer.set_bus_volume_db(SettingsData.MUSIC_BUS_ID, linear_to_db(s.music_volume))
AudioServer.set_bus_volume_db(SettingsData.SFX_BUS_ID, linear_to_db(s.sfx_volume))
AudioServer.set_bus_volume_db(SettingsData.AMBIANCE_BUS_ID, linear_to_db(s.ambiance_volume))
func _on_timeline_started():
var dialog_path = Dialogic.current_timeline.resource_path
if not dialog_path in game_data.dialogs_done:
game_data.dialogs_done.append(dialog_path)
save_game_data()
func update_language_settings(s : SettingsData = settings_data):
TranslationServer.set_locale(s.language)

View File

@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dcgnamu7sb3ov"
path="res://.godot/imported/bolt.svg-a559d5e701996c7d105fc68102331434.ctex"
path.s3tc="res://.godot/imported/bolt.svg-a559d5e701996c7d105fc68102331434.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/bolt.svg"
dest_files=["res://.godot/imported/bolt.svg-a559d5e701996c7d105fc68102331434.ctex"]
dest_files=["res://.godot/imported/bolt.svg-a559d5e701996c7d105fc68102331434.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,7 +38,7 @@ 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
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-instagram"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 8a4 4 0 0 1 4 -4h8a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-8a4 4 0 0 1 -4 -4l0 -8" /><path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" /><path d="M16.5 7.5v.01" /></svg>

After

Width:  |  Height:  |  Size: 469 B

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dh1jaup4y1f6q"
path="res://.godot/imported/brand-instagram.svg-93b67e1c651e77c13169000f3fa1764f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://common/icons/brand-instagram.svg"
dest_files=["res://.godot/imported/brand-instagram.svg-93b67e1c651e77c13169000f3fa1764f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-steam"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M16.5 5a4.5 4.5 0 1 1 -.653 8.953l-4.347 3.009l0 .038a3 3 0 0 1 -2.824 3l-.176 0a3 3 0 0 1 -2.94 -2.402l-2.56 -1.098v-3.5l3.51 1.755a2.989 2.989 0 0 1 2.834 -.635l2.727 -3.818a4.5 4.5 0 0 1 4.429 -5.302" /><path d="M15.5 9.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" fill="#ffffff" /></svg>

After

Width:  |  Height:  |  Size: 584 B

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cpkye7t28ragp"
path="res://.godot/imported/brand-steam.svg-9dbbdc409ded6b7066179206cac90cca.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://common/icons/brand-steam.svg"
dest_files=["res://.godot/imported/brand-steam.svg-9dbbdc409ded6b7066179206cac90cca.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-broadcast"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18.364 19.364a9 9 0 1 0 -12.728 0" /><path d="M15.536 16.536a5 5 0 1 0 -7.072 0" /><path d="M11 13a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>

After

Width:  |  Height:  |  Size: 442 B

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qshtr3peinak"
path="res://.godot/imported/broadcast.svg-d7376e52ecc5b74fcdaea71ccbe04a97.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://common/icons/broadcast.svg"
dest_files=["res://.godot/imported/broadcast.svg-d7376e52ecc5b74fcdaea71ccbe04a97.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://baaujfw8piywi"
path="res://.godot/imported/dna.svg-0d37cb06a607035637eb8d87826b10a6.ctex"
path.s3tc="res://.godot/imported/dna.svg-0d37cb06a607035637eb8d87826b10a6.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/dna.svg"
dest_files=["res://.godot/imported/dna.svg-0d37cb06a607035637eb8d87826b10a6.ctex"]
dest_files=["res://.godot/imported/dna.svg-0d37cb06a607035637eb8d87826b10a6.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,7 +38,7 @@ 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
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b43thuq8piv18"
path="res://.godot/imported/skull.svg-1f3a01497295060c28293df722ed0ddd.ctex"
path.s3tc="res://.godot/imported/skull.svg-1f3a01497295060c28293df722ed0ddd.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/skull.svg"
dest_files=["res://.godot/imported/skull.svg-1f3a01497295060c28293df722ed0ddd.ctex"]
dest_files=["res://.godot/imported/skull.svg-1f3a01497295060c28293df722ed0ddd.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,7 +38,7 @@ 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
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b6dwhn0uotdgu"
path="res://.godot/imported/square-rounded-nofill.svg-3b394b5967765acc26d391129de152eb.ctex"
path.s3tc="res://.godot/imported/square-rounded-nofill.svg-3b394b5967765acc26d391129de152eb.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/square-rounded-nofill.svg"
dest_files=["res://.godot/imported/square-rounded-nofill.svg-3b394b5967765acc26d391129de152eb.ctex"]
dest_files=["res://.godot/imported/square-rounded-nofill.svg-3b394b5967765acc26d391129de152eb.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,7 +38,7 @@ 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
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://rdrhi3r11ey6"
path="res://.godot/imported/square-rounded.svg-4eece25055f2b80264664150c832a797.ctex"
path.s3tc="res://.godot/imported/square-rounded.svg-4eece25055f2b80264664150c832a797.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/square-rounded.svg"
dest_files=["res://.godot/imported/square-rounded.svg-4eece25055f2b80264664150c832a797.ctex"]
dest_files=["res://.godot/imported/square-rounded.svg-4eece25055f2b80264664150c832a797.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,7 +38,7 @@ 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
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -1,10 +1,10 @@
[gd_resource type="Resource" script_class="Scene" load_steps=2 format=3 uid="uid://bvksiaiocwob5"]
[gd_resource type="Resource" script_class="Scene" format=3 uid="uid://bvksiaiocwob5"]
[ext_resource type="Script" uid="uid://1ejbvr3431ac" path="res://common/scene_manager/scripts/scene.gd" id="1_tkiq8"]
[resource]
script = ExtResource("1_tkiq8")
scene_id = "COCKPIT"
scene_path = "res://stages/cockpit/cockpit.tscn"
scene_path = "res://stages/3d_scenes/cockpit_scene/cockpit_scene.tscn"
mouse_captured = true
metadata/_custom_type_script = "uid://1ejbvr3431ac"