[gd_scene format=3 uid="uid://c8k7h4fvtqxqm"]

[ext_resource type="Script" uid="uid://dfyo0h5yj3us8" path="res://scripts/trainjourney.gd" id="1_0nial"]
[ext_resource type="PackedScene" uid="uid://csm5ihvpyw5m7" path="res://scenes/main.tscn" id="2_7fone"]
[ext_resource type="Script" uid="uid://bymoo78gun6a4" path="res://scripts/track_generator.gd" id="2_j07ug"]
[ext_resource type="PackedScene" uid="uid://cer3o7xlhju7v" path="res://scenes/train.tscn" id="3_7fone"]
[ext_resource type="Script" uid="uid://cvn333pymsowx" path="res://scripts/train.gd" id="4_7brvr"]
[ext_resource type="Script" uid="uid://cgy51h6a5syer" path="res://scripts/trainjourney_camera.gd" id="5_4toc1"]
[ext_resource type="Texture2D" uid="uid://bi2atrvjj23tk" path="res://resources/audio_on.png" id="6_bapl2"]
[ext_resource type="PackedScene" uid="uid://qrf08uiuhyqg" path="res://scenes/musicmanager.tscn" id="7_ilqki"]
[ext_resource type="Texture2D" uid="uid://n6bjl02ikh00" path="res://resources/audio_off.png" id="8_k6j2o"]
[ext_resource type="PackedScene" uid="uid://by7iywhy2d8uy" path="res://scenes/gamestate.tscn" id="9_nwfv8"]

[sub_resource type="LabelSettings" id="LabelSettings_tbgi4"]
font_color = Color(0, 0, 0, 1)

[sub_resource type="LabelSettings" id="LabelSettings_tefeu"]
font_color = Color(0, 0, 0, 1)

[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_tefeu"]
sky_top_color = Color(0.6262097, 0.76737565, 0.9309246, 1)
sky_horizon_color = Color(0.82665706, 0.8808251, 0.95468724, 1)
ground_bottom_color = Color(0.5370987, 0.48452926, 0.42358288, 1)
ground_horizon_color = Color(0.7014107, 0.735357, 0.7014107, 1)

[sub_resource type="Sky" id="Sky_0nial"]
sky_material = SubResource("ProceduralSkyMaterial_tefeu")

[sub_resource type="Environment" id="Environment_tipki"]
background_mode = 2
sky = SubResource("Sky_0nial")
ambient_light_source = 3
ambient_light_energy = 0.6
tonemap_mode = 3
fog_enabled = true
fog_light_color = Color(0.85430586, 0.8808251, 0.9063318, 1)
fog_density = 0.0015

[node name="TrainJourney" type="Node3D" unique_id=1963280672]
script = ExtResource("1_0nial")
main_scene = ExtResource("2_7fone")

[node name="TrackGenerator" type="Node3D" parent="." unique_id=1804102656]
script = ExtResource("2_j07ug")
track_width = 1.0
sleeper_width = 1.5
segments_behind = 7

[node name="Train" parent="." unique_id=1314026371 instance=ExtResource("3_7fone")]
script = ExtResource("4_7brvr")
wagon_spacing = 2.65

[node name="TrainCamera" type="Camera3D" parent="." unique_id=1701124966]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 20)
current = true
fov = 60.0
script = ExtResource("5_4toc1")
follow_distance = 20.0
follow_height = 8.0

[node name="HUD" type="Control" parent="." unique_id=833826261]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="tripdistance_label" type="Label" parent="HUD" unique_id=1839637385]
layout_mode = 0
offset_left = 20.0
offset_top = 44.0
offset_right = 1280.0
offset_bottom = 67.0
size_flags_vertical = 0
text = "Distanza viaggio: 0"
label_settings = SubResource("LabelSettings_tbgi4")

[node name="speed_label" type="Label" parent="HUD" unique_id=122503890]
layout_mode = 0
offset_left = 20.0
offset_top = 20.0
offset_right = 1280.0
offset_bottom = 43.0
size_flags_vertical = 0
text = "Velocità: 0"
label_settings = SubResource("LabelSettings_tefeu")

[node name="camera_label" type="Label" parent="HUD" unique_id=83899204]
layout_mode = 0
offset_left = 20.0
offset_top = 149.0
offset_right = 1280.0
offset_bottom = 172.0
size_flags_vertical = 0
text = "Camera: "
label_settings = SubResource("LabelSettings_tefeu")

[node name="controls_label" type="Label" parent="HUD" unique_id=1666328438]
layout_mode = 0
offset_left = 20.0
offset_top = 170.0
offset_right = 1280.0
offset_bottom = 297.0
size_flags_vertical = 0
text = "Comandi: 
\"W / S - Accelera / Rallenta\",
\"A / D - Ruota camera\",
\"SPACE - Cambia camera\",
\"TAB - Cambia treno\",
\"ESC - Esci\""
label_settings = SubResource("LabelSettings_tefeu")

[node name="totaldistance_label" type="Label" parent="HUD" unique_id=544099778]
layout_mode = 0
offset_left = 20.0
offset_top = 68.0
offset_right = 1280.0
offset_bottom = 91.0
size_flags_vertical = 0
text = "Distanza totale: 0"
label_settings = SubResource("LabelSettings_tbgi4")

[node name="audio_button" type="Button" parent="HUD" unique_id=770880228]
layout_mode = 0
offset_left = 6.0
offset_top = 678.0
offset_right = 181.0
offset_bottom = 854.0
scale = Vector2(0.2, 0.2)
icon = ExtResource("6_bapl2")
flat = true

[node name="triptime_label" type="Label" parent="HUD" unique_id=61311648]
layout_mode = 0
offset_left = 19.0
offset_top = 94.0
offset_right = 1279.0
offset_bottom = 117.0
size_flags_vertical = 0
text = "Tempo viaggio: 0"
label_settings = SubResource("LabelSettings_tbgi4")

[node name="totaltime_label" type="Label" parent="HUD" unique_id=2138643407]
layout_mode = 0
offset_left = 19.0
offset_top = 117.0
offset_right = 1279.0
offset_bottom = 140.0
size_flags_vertical = 0
text = "Tempo totale: 0"
label_settings = SubResource("LabelSettings_tbgi4")

[node name="MusicManager" parent="." unique_id=445447211 instance=ExtResource("7_ilqki")]
icon_active = ExtResource("6_bapl2")
icon_inactive = ExtResource("8_k6j2o")

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1793402357]
light_energy = 1.3
shadow_enabled = true
shadow_bias = 0.04

[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1578392535]
environment = SubResource("Environment_tipki")

[node name="GameState" parent="." unique_id=278367250 groups=["save_data"] instance=ExtResource("9_nwfv8")]

[node name="AutoSaveTimer" type="Timer" parent="." unique_id=2087834857]
wait_time = 10.0

[node name="TripTime" type="Timer" parent="." unique_id=599791207]
autostart = true

[connection signal="pressed" from="HUD/audio_button" to="MusicManager" method="_on_audio_button_pressed"]
[connection signal="timeout" from="AutoSaveTimer" to="." method="_on_timer_timeout"]
[connection signal="timeout" from="TripTime" to="." method="_on_trip_time_timeout"]
