Ajout d'un mode infini
This commit is contained in:
@@ -14,7 +14,9 @@ var planet_spin_ach_sended = false
|
||||
|
||||
func _ready():
|
||||
%Version.text = ProjectSettings.get_setting("application/config/version")
|
||||
%Start.text = tr("CONTINUE") if GameInfo.game_data else tr("START")
|
||||
%Start.text = tr("CONTINUE") if GameInfo.story_game_data else tr("START")
|
||||
%StartInfinite.visible = GameInfo.has_unlocked_infinite_mode()
|
||||
%StartInfinite.text = tr("INFINITE_MODE")
|
||||
%Restart.visible = GameInfo.game_data != null
|
||||
%Settings.close_settings()
|
||||
%Controls.close_controls()
|
||||
@@ -27,6 +29,7 @@ func _ready():
|
||||
decontaminate_3D_planet(GameInfo.game_data)
|
||||
|
||||
func _on_start_pressed():
|
||||
GameInfo.game_mode_choosen = GameData.Mode.STORY
|
||||
if GameInfo.game_data :
|
||||
if GameInfo.game_data.last_game_scene:
|
||||
SceneManager.change_to_scene(GameInfo.game_data.last_game_scene)
|
||||
@@ -38,11 +41,8 @@ func _on_start_pressed():
|
||||
|
||||
func decontaminate_3D_planet(game_data):
|
||||
%Planet3d.fertility_factor = (
|
||||
max(0,float(GameInfo.game_data.progression_data.story_step_i))
|
||||
/ len(
|
||||
GameInfo.game_data.progression_data.get_all_story_steps()
|
||||
)
|
||||
)
|
||||
GameInfo.game_data.progression_data.get_story_progression()
|
||||
)
|
||||
|
||||
func _process(delta):
|
||||
next_mouse_pos = get_viewport().get_mouse_position()
|
||||
@@ -76,6 +76,7 @@ func _process(delta):
|
||||
|
||||
|
||||
func _on_restart_button_down():
|
||||
GameInfo.game_mode_choosen = GameData.Mode.STORY
|
||||
GameInfo.start_game_data()
|
||||
SceneManager.change_to_scene(IntroScene.new())
|
||||
|
||||
@@ -88,3 +89,15 @@ func _on_controls_button_down():
|
||||
func _on_quit_button_down():
|
||||
get_tree().quit()
|
||||
|
||||
func _on_start_infinite_pressed():
|
||||
GameInfo.game_mode_choosen = GameData.Mode.INFINITE
|
||||
if GameInfo.game_data :
|
||||
if GameInfo.game_data.last_game_scene:
|
||||
SceneManager.change_to_scene(GameInfo.game_data.last_game_scene)
|
||||
else :
|
||||
SceneManager.change_to_scene(CockpitScene.new())
|
||||
else:
|
||||
GameInfo.start_game_data()
|
||||
SceneManager.change_to_scene(
|
||||
GameInfo.game_data.progression_data.get_story_step().get_respawn_scene()
|
||||
)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_4ph5l"]
|
||||
[ext_resource type="Script" uid="uid://cwmp2une7hobe" path="res://stages/title_screen/scripts/title_screen.gd" id="1_6yuhi"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_6yuhi"]
|
||||
[ext_resource type="Texture2D" uid="uid://cdpqg3pkjcw2h" path="res://stages/title_screen/assets/textures/title.png" id="3_lwj2x"]
|
||||
[ext_resource type="Texture2D" uid="uid://cvvnrj8wi3f3r" path="res://common/icons/brand-twitch.svg" id="3_gn4uv"]
|
||||
[ext_resource type="Texture2D" uid="uid://cdpqg3pkjcw2h" path="res://stages/title_screen/assets/textures/title.png" id="3_lwj2x"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_ofiho"]
|
||||
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://common/icons/rotate.svg" id="5_6yuhi"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm5b7w7j6527f" path="res://stages/title_screen/planet_3d.tscn" id="5_7a1qq"]
|
||||
@@ -66,48 +66,12 @@ _data = {
|
||||
&"bounce": SubResource("Animation_0vds4")
|
||||
}
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rf16a"]
|
||||
bg_color = Color(1, 0, 0.43137255, 1)
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
border_color = Color(1, 0, 0.43137255, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gn4uv"]
|
||||
bg_color = Color(0.78039217, 0, 0.3372549, 1)
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
border_color = Color(0.78, 0, 0.33800003, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ofiho"]
|
||||
bg_color = Color(1, 0.24000001, 0.5693334, 1)
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
border_color = Color(1, 0.23921569, 0.5686275, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lwj2x"]
|
||||
shader = ExtResource("8_pjo5j")
|
||||
shader_parameter/strength = 5.00000023424012
|
||||
shader_parameter/mix_percentage = 0.3
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_rf16a"]
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_gn4uv"]
|
||||
frequency = 1.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_gn4uv"]
|
||||
@@ -207,6 +171,18 @@ tracks/7/keys = {
|
||||
"update": 1,
|
||||
"values": [1.0]
|
||||
}
|
||||
tracks/8/type = "value"
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/path = NodePath("%StartInfinite:modulate:a")
|
||||
tracks/8/interp = 1
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [1.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ofiho"]
|
||||
resource_name = "arrive"
|
||||
@@ -306,6 +282,18 @@ tracks/7/keys = {
|
||||
"update": 0,
|
||||
"values": [0.0, 1.0]
|
||||
}
|
||||
tracks/8/type = "value"
|
||||
tracks/8/imported = false
|
||||
tracks/8/enabled = true
|
||||
tracks/8/path = NodePath("%StartInfinite:modulate:a")
|
||||
tracks/8/interp = 2
|
||||
tracks/8/loop_wrap = true
|
||||
tracks/8/keys = {
|
||||
"times": PackedFloat32Array(0.33333334, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [0.0, 1.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_1xafb"]
|
||||
_data = {
|
||||
@@ -409,6 +397,18 @@ theme_override_font_sizes/font_size = 33
|
||||
text = "START"
|
||||
icon = ExtResource("3_6yuhi")
|
||||
|
||||
[node name="StartInfinite" type="Button" parent="MarginContainer/GridContainer/VBoxContainer/VBoxContainer" unique_id=1255171640]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource("1_4ph5l")
|
||||
theme_override_font_sizes/font_size = 33
|
||||
text = "INFINITE_MODE"
|
||||
icon = ExtResource("12_igvpv")
|
||||
flat = true
|
||||
|
||||
[node name="Settings" type="Button" parent="MarginContainer/GridContainer/VBoxContainer/VBoxContainer" unique_id=381312431]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
@@ -430,7 +430,7 @@ layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource("1_4ph5l")
|
||||
text = "RESTART_DEMO"
|
||||
text = "RESTART_HISTORY_MODE"
|
||||
icon = ExtResource("5_6yuhi")
|
||||
flat = true
|
||||
|
||||
@@ -523,7 +523,7 @@ size = Vector2i(1980, 1080)
|
||||
|
||||
[node name="Planet3d" parent="SubViewport" unique_id=926789923 instance=ExtResource("5_7a1qq")]
|
||||
unique_name_in_owner = true
|
||||
noise = SubResource("FastNoiseLite_rf16a")
|
||||
noise = SubResource("FastNoiseLite_gn4uv")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="SubViewport" unique_id=806252928]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.369979, 0, 64.323425)
|
||||
@@ -554,6 +554,7 @@ z_index = 100
|
||||
mouse_filter = 2
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/GridContainer/VBoxContainer/VBoxContainer/Start" to="." method="_on_start_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/GridContainer/VBoxContainer/VBoxContainer/StartInfinite" to="." method="_on_start_infinite_pressed"]
|
||||
[connection signal="button_down" from="MarginContainer/GridContainer/VBoxContainer/VBoxContainer/Settings" to="." method="_on_settings_button_down"]
|
||||
[connection signal="button_down" from="MarginContainer/GridContainer/VBoxContainer/VBoxContainer/Controls" to="." method="_on_controls_button_down"]
|
||||
[connection signal="button_down" from="MarginContainer/GridContainer/VBoxContainer/VBoxContainer/Restart" to="." method="_on_restart_button_down"]
|
||||
|
||||
Reference in New Issue
Block a user