developpement d'écran de chargement et d'écran de sélection de niveau
* modification de certains assets * optimisation de chunks * ajout d'un SceneManager * ajout d'un premier dialogue avec Demeter * changement des jour en charge * mise en place d'un système de run * etc...
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://fnv0qhkh40mv"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_0ssee"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_0ssee"]
|
||||
[ext_resource type="Script" uid="uid://bvb4v66bqteuc" path="res://gui/game/announce/scripts/announce.gd" id="1_4evne"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_yrhd4"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_7nrno"]
|
||||
|
||||
320
gui/game/build_menu/build_menu.tscn
Normal file
320
gui/game/build_menu/build_menu.tscn
Normal file
@@ -0,0 +1,320 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://xmfjxrn7m6vo"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://rxao2rluuwqq" path="res://gui/game/screen/screen.tscn" id="1_8bdn3"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_vpxyy"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_ou1lu"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_m0jcy"]
|
||||
[ext_resource type="Texture2D" uid="uid://n7hhyqhhtx0q" path="res://entities/interactables/truck/compost/assets/sprites/compost.png" id="4_ywwbf"]
|
||||
[ext_resource type="Texture2D" uid="uid://b0wy3dbpxbnt7" path="res://common/icons/seedling.svg" id="6_jn707"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="7_0715l"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="8_8iodd"]
|
||||
[ext_resource type="Texture2D" uid="uid://ds4m14vl7he6v" path="res://common/icons/pick.svg" id="9_1f0ht"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_foxij"]
|
||||
content_margin_left = 20.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 8.0
|
||||
content_margin_bottom = 20.0
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(1, 1, 1, 0.54509807)
|
||||
corner_radius_top_left = 100
|
||||
corner_radius_top_right = 100
|
||||
corner_radius_bottom_right = 100
|
||||
corner_radius_bottom_left = 100
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hf34d"]
|
||||
content_margin_left = 20.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 8.0
|
||||
content_margin_bottom = 20.0
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 100
|
||||
corner_radius_top_right = 100
|
||||
corner_radius_bottom_right = 100
|
||||
corner_radius_bottom_left = 100
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_t7tak"]
|
||||
font = ExtResource("4_m0jcy")
|
||||
|
||||
[node name="BuildMenu" type="MarginContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 30
|
||||
theme_override_constants/margin_top = 30
|
||||
theme_override_constants/margin_right = 30
|
||||
theme_override_constants/margin_bottom = 30
|
||||
|
||||
[node name="Screen" parent="." instance=ExtResource("1_8bdn3")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="Screen/ScreenContainer" index="0"]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Categories" type="GridContainer" parent="Screen/ScreenContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme = ExtResource("2_vpxyy")
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
custom_minimum_size = Vector2(0, 40)
|
||||
layout_mode = 2
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_foxij")
|
||||
theme_override_styles/focus = SubResource("StyleBoxFlat_hf34d")
|
||||
placeholder_text = "Search blueprints..."
|
||||
|
||||
[node name="Category" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("3_ou1lu")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("4_ywwbf")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Compost"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "2"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_ou1lu")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "3"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button2" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("7_0715l")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Panneau solaire"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "5"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Category2" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2"]
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("8_8iodd")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("7_0715l")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Fertiliseur"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "2"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_ou1lu")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "3"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Category3" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3"]
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("9_1f0ht")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("7_0715l")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Foreuse"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "5"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[editable path="Screen"]
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=19 format=3 uid="uid://753270jjxmfg"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_m317d"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_m317d"]
|
||||
[ext_resource type="Script" uid="uid://b7f10wuounfan" path="res://gui/game/card/scripts/card.gd" id="2_kpm7h"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_plgbn"]
|
||||
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="3_7wc8v"]
|
||||
@@ -52,7 +52,7 @@ _data = {
|
||||
[node name="Card" type="PanelContainer"]
|
||||
custom_minimum_size = Vector2(250, 0)
|
||||
offset_right = 250.0
|
||||
offset_bottom = 377.0
|
||||
offset_bottom = 229.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("1_m317d")
|
||||
@@ -131,6 +131,7 @@ theme_override_constants/separation = 6
|
||||
|
||||
[node name="CardSections" type="MarginContainer" parent="GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CardSectionsContainer" type="VBoxContainer" parent="GridContainer/CardSections"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bghefrgaujjt6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dcmee2jvohudl" path="res://gui/game/card/scripts/card_section.gd" id="1_41hkv"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_t7m3x"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_t7m3x"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="2_3ktqg"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="2_41hkv"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="3_3ktqg"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cpen6hj0rbw8x"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_6abif"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_6abif"]
|
||||
[ext_resource type="Script" uid="uid://c8xxhu28xm4hy" path="res://gui/game/card/scripts/card_stat.gd" id="2_30iht"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="3_30iht"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="3_c3wpw"]
|
||||
|
||||
@@ -46,8 +46,8 @@ metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
|
||||
shader = ExtResource("1_x54se")
|
||||
shader_parameter/fov = 90.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = 0.00018062632
|
||||
shader_parameter/x_rot = -0.00042293756
|
||||
shader_parameter/y_rot = -6.6836714e-05
|
||||
shader_parameter/x_rot = -7.941689e-05
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1et8x"]
|
||||
@@ -110,10 +110,8 @@ theme_override_constants/margin_bottom = 25
|
||||
|
||||
[node name="Card" parent="SubViewportContainer/SubViewport/CardContainer" instance=ExtResource("1_we78f")]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
small_mode = true
|
||||
down_arrow = true
|
||||
info = SubResource("Resource_eb1v6")
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
[gd_scene load_steps=23 format=3 uid="uid://12nak7amd1uq"]
|
||||
[gd_scene load_steps=22 format=3 uid="uid://12nak7amd1uq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/game/scripts/game_gui.gd" id="1_udau0"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_nq5i2"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_nq5i2"]
|
||||
[ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_h6540"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="4_k4juk"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_ujg5r"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="5_2wykm"]
|
||||
[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="6_id0t5"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="7_id0t5"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5cuxgisrsfgt" path="res://common/icons/player-pause.svg" id="9_2wykm"]
|
||||
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_2wykm"]
|
||||
@@ -210,12 +209,12 @@ stretch_mode = 5
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[node name="DayCount" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="ChargeCount" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
text = "Day 0"
|
||||
text = "%d_CHARGE_LEFT"
|
||||
label_settings = ExtResource("4_ujg5r")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -238,7 +237,7 @@ grow_vertical = 2
|
||||
theme_override_constants/separation = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="QuotaProgressText" type="Label" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
[node name="ObjectiveProgressText" type="Label" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "X"
|
||||
@@ -246,27 +245,13 @@ label_settings = ExtResource("4_ujg5r")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
[node name="ObjectiveIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("7_id0t5")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="TopRightContent" type="HBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Pause" type="Button" parent="MarginContainer/TopRightContent"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 0
|
||||
focus_mode = 0
|
||||
mouse_filter = 1
|
||||
icon = ExtResource("9_2wykm")
|
||||
|
||||
[node name="Inventory" parent="MarginContainer" instance=ExtResource("9_id0t5")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
@@ -308,5 +293,3 @@ libraries = {
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_p0xoq")
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/TopRightContent/Pause" to="." method="_on_pause_pressed"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dinju2m0oja38"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_1ddv5"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_1ddv5"]
|
||||
[ext_resource type="Script" uid="uid://ymn5layeoat8" path="res://gui/game/inspector/framed_info/scripts/framed_info.gd" id="1_7tmbd"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_7tmbd"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="3_1ddv5"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://d3lff5fui1k0c"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_f5bv4"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_f5bv4"]
|
||||
[ext_resource type="Texture2D" uid="uid://lpik6kwqgmjx" path="res://gui/game/assets/texture/tablette_resized.png" id="1_qfinp"]
|
||||
[ext_resource type="Script" uid="uid://b36bjfq4sng36" path="res://gui/game/inspector/scripts/inspector.gd" id="3_a8c2j"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_qfinp"]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://yghu53hja4xj" path="res://gui/game/inspector/stat_info/scripts/stat_info.gd" id="1_4pua2"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_pdlch"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_pdlch"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_pdlch"]
|
||||
|
||||
[node name="StatInfo" type="HBoxContainer"]
|
||||
theme_override_constants/separation = 4
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=17 format=3 uid="uid://csiacsndm62ll"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_51ks3"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_51ks3"]
|
||||
[ext_resource type="Script" uid="uid://crt2d4m5ba25i" path="res://gui/game/pause/scripts/pause.gd" id="1_he4ox"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_apjlw"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_apjlw"]
|
||||
[ext_resource type="PackedScene" uid="uid://g6lbgg1fhc25" path="res://gui/menu/settings/settings.tscn" id="4_58dya"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_apjlw"]
|
||||
[ext_resource type="Texture2D" uid="uid://vmsn54d1ptih" path="res://common/icons/player-play.svg" id="5_apjlw"]
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture,repeat_disable, filter_nearest;
|
||||
/**
|
||||
* How blurry the result should be.
|
||||
* Limited to 20 because of performance, if you want feel free to break it.
|
||||
*/
|
||||
uniform float strength : hint_range(0.1, 20.0) = 3.3;
|
||||
/**
|
||||
* How dark the blur will be
|
||||
*/
|
||||
uniform float mix_percentage: hint_range(0.0, 1.0) = 0.3;
|
||||
|
||||
float gaussianDistribution(float x, float STD){ // STD stands for standard deviation
|
||||
return exp(-(x*x)/(2.*STD*STD))/(sqrt(2.*PI)*STD);
|
||||
}
|
||||
|
||||
vec3 gaussianblur(sampler2D sampler, vec2 pos, vec2 pixel_size, float sigmaUsed, int radius){
|
||||
vec3 blurredPixel = vec3(0.0);
|
||||
float total_weight = 0.0;
|
||||
// Loop over the radius (tecnically its a square)
|
||||
for(int i = -radius ; i <= radius; i++){
|
||||
for(int j = -radius; j <= radius; j++){
|
||||
// Calculate the offset from the current pixel
|
||||
vec2 offset = vec2(float(i), float(j))*pixel_size;
|
||||
vec2 changedPos = pos + offset;
|
||||
|
||||
// Calculate the weight based on the Gaussian distribution multiplying both dimentions (how far are X and Y form the center (pos))
|
||||
float weight = gaussianDistribution(float(i), sigmaUsed)*gaussianDistribution(float(j), sigmaUsed);
|
||||
// Add the weighted color value to the blurred pixel
|
||||
blurredPixel += texture(SCREEN_TEXTURE, changedPos).rgb * weight;
|
||||
total_weight += weight;
|
||||
}
|
||||
}
|
||||
// Normalize the blurred pixel color by the total weight
|
||||
blurredPixel/=total_weight;
|
||||
return blurredPixel;
|
||||
}
|
||||
void fragment() {
|
||||
vec3 PixelBlurred = gaussianblur(SCREEN_TEXTURE, SCREEN_UV, SCREEN_PIXEL_SIZE, strength, int(round(3.0 * strength)));
|
||||
vec3 color = mix(PixelBlurred, vec3(0.0), mix_percentage);
|
||||
// The radius is 3*strength because it is the point where the Gaussian weight is near zero.
|
||||
COLOR = vec4(color, 1.);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://cuni3ggtw2uuy
|
||||
@@ -2,39 +2,37 @@ extends CanvasLayer
|
||||
|
||||
var pause = false : set = set_pause
|
||||
|
||||
const PLANET_RUN_SCENE = preload("res://stages/planet_run/planet_run.tscn")
|
||||
|
||||
func set_pause(p):
|
||||
if p != pause:
|
||||
if p:
|
||||
%AnimationPlayer.play("pause")
|
||||
else:
|
||||
%AnimationPlayer.play_backwards("pause")
|
||||
pause = p
|
||||
get_tree().paused = pause
|
||||
%Settings.close_settings()
|
||||
%Controls.close_controls()
|
||||
if p != pause:
|
||||
if p:
|
||||
%AnimationPlayer.play("pause")
|
||||
else:
|
||||
%AnimationPlayer.play_backwards("pause")
|
||||
pause = p
|
||||
get_tree().paused = pause
|
||||
%Settings.close_settings()
|
||||
%Controls.close_controls()
|
||||
|
||||
func _input(_event):
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
pause = not pause
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
pause = not pause
|
||||
|
||||
func _on_resume_pressed():
|
||||
pause = false
|
||||
pause = false
|
||||
|
||||
func _on_restart_pressed():
|
||||
GameInfo.game_data.reset_all()
|
||||
pause = false
|
||||
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
|
||||
GameInfo.game_data.reset_all()
|
||||
pause = false
|
||||
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
get_tree().quit()
|
||||
|
||||
func _on_game_gui_pause_asked():
|
||||
pause = true
|
||||
pause = true
|
||||
|
||||
func _on_settings_pressed():
|
||||
%Settings.open_settings()
|
||||
%Settings.open_settings()
|
||||
|
||||
func _on_controls_pressed():
|
||||
%Controls.open_controls()
|
||||
%Controls.open_controls()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://doxm7uab8i3tq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://12kjdou2kp5y" path="res://gui/game/quota_reward/scripts/quota_reward.gd" id="1_gye62"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_6ibex"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_x2kx4"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_6ibex"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_x2kx4"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_trw0e"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gy0la"]
|
||||
|
||||
26
gui/game/screen/screen.tscn
Normal file
26
gui/game/screen/screen.tscn
Normal file
@@ -0,0 +1,26 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://rxao2rluuwqq"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dwbg8ec5hdall" path="res://gui/game/screen/textures/screen.png" id="1_cq61g"]
|
||||
|
||||
[node name="Screen" type="NinePatchRect"]
|
||||
z_index = 1
|
||||
offset_right = 235.0
|
||||
offset_bottom = 171.0
|
||||
texture = ExtResource("1_cq61g")
|
||||
region_rect = Rect2(0, 0, 491, 520)
|
||||
patch_margin_left = 64
|
||||
patch_margin_top = 58
|
||||
patch_margin_right = 171
|
||||
patch_margin_bottom = 113
|
||||
|
||||
[node name="ScreenContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_top = 55
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 20
|
||||
BIN
gui/game/screen/textures/screen.png
Normal file
BIN
gui/game/screen/textures/screen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
40
gui/game/screen/textures/screen.png.import
Normal file
40
gui/game/screen/textures/screen.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dwbg8ec5hdall"
|
||||
path="res://.godot/imported/screen.png-1ecb35aaa1bf9bad00eac50aeedbccbb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/game/screen/textures/screen.png"
|
||||
dest_files=["res://.godot/imported/screen.png-1ecb35aaa1bf9bad00eac50aeedbccbb.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
|
||||
@@ -3,133 +3,110 @@ class_name GameGui
|
||||
|
||||
const SCORE_ICON : Texture = preload("res://common/icons/growth.svg")
|
||||
|
||||
@export var quota_reward : QuotaReward
|
||||
|
||||
func _ready():
|
||||
GameInfo.game_data.current_planet_data.updated.connect(_on_planet_updated)
|
||||
GameInfo.game_data.current_planet_data.plant_gaining_score.connect(_on_plant_gaining_score)
|
||||
GameInfo.game_data.current_planet_data.new_quota_started.connect(_on_planet_new_quota_started)
|
||||
GameInfo.game_data.player_data.updated.connect(_on_player_updated)
|
||||
GameInfo.game_data.player_data.inventory.updated.connect(_on_inventory_updated)
|
||||
GameInfo.game_data.current_planet_data.updated.connect(_on_planet_updated)
|
||||
GameInfo.game_data.current_planet_data.plant_gaining_score.connect(_on_plant_gaining_score)
|
||||
GameInfo.game_data.player_data.updated.connect(_on_player_updated)
|
||||
GameInfo.game_data.player_data.inventory.updated.connect(_on_inventory_updated)
|
||||
|
||||
planet_update(GameInfo.game_data.current_planet_data, false)
|
||||
player_update(GameInfo.game_data.player_data, false)
|
||||
inventory_update(GameInfo.game_data.player_data.inventory)
|
||||
|
||||
if not GameInfo.game_data.current_planet_data.is_quota_announced:
|
||||
await quota_reward.reward_chosen
|
||||
announce_quota(GameInfo.game_data.current_planet_data)
|
||||
GameInfo.game_data.current_planet_data.is_quota_announced = true
|
||||
%EnergyInfo.update_minimum_size()
|
||||
planet_update(GameInfo.game_data.current_planet_data, false)
|
||||
player_update(GameInfo.game_data.player_data, false)
|
||||
inventory_update(GameInfo.game_data.player_data.inventory)
|
||||
|
||||
%EnergyInfo.update_minimum_size()
|
||||
|
||||
|
||||
func _on_player_updated(player_data : PlayerData):
|
||||
player_update(player_data)
|
||||
player_update(player_data)
|
||||
|
||||
func player_update(player_data : PlayerData, with_animation = true):
|
||||
var energy_count_text = "[b]%d[/b] / %d" % [player_data.energy, player_data.max_energy]
|
||||
var energy_count_text = "[b]%d[/b] / %d" % [player_data.energy, player_data.max_energy]
|
||||
|
||||
if energy_count_text != %EnergyCount.text and with_animation:
|
||||
%EnergyAnimationPlayer.bounce()
|
||||
%EnergyCount.text = energy_count_text
|
||||
%EnergyInfo.modulate = Color.WHITE if player_data.energy > 0 else Color.RED
|
||||
if energy_count_text != %EnergyCount.text and with_animation:
|
||||
%EnergyAnimationPlayer.bounce()
|
||||
%EnergyCount.text = energy_count_text
|
||||
%EnergyInfo.modulate = Color.WHITE if player_data.energy > 0 else Color.RED
|
||||
|
||||
func _on_inventory_updated(inventory : Inventory):
|
||||
inventory_update(inventory)
|
||||
inventory_update(inventory)
|
||||
|
||||
func inventory_update(inventory : Inventory):
|
||||
%Inventory.update(inventory)
|
||||
%Inventory.update(inventory)
|
||||
|
||||
func _on_planet_updated(planet_data : PlanetData):
|
||||
planet_update(planet_data)
|
||||
planet_update(planet_data)
|
||||
|
||||
func planet_update(planet_data : PlanetData, with_animation = true):
|
||||
if planet_data:
|
||||
%DayCount.text = tr("%d_DAY_LEFT") % (planet_data.quota_days)
|
||||
if planet_data:
|
||||
%ChargeCount.text = tr("%d_CHARGE_LEFT") % (planet_data.charges)
|
||||
|
||||
var quota_progression_percent : float = (float(planet_data.garden_score) / float(planet_data.get_quota_score())) * 100
|
||||
%QuotaProgressText.text = "%d/%d" % [planet_data.garden_score, planet_data.get_quota_score()]
|
||||
var objective_progression_percent : float = (float(planet_data.garden_score) / float(planet_data.objective)) * 100
|
||||
%ObjectiveProgressText.text = "%d/%d" % [planet_data.garden_score, planet_data.objective]
|
||||
|
||||
if with_animation:
|
||||
get_tree().create_tween().tween_property(
|
||||
%QuotaProgressBar,
|
||||
"value",
|
||||
quota_progression_percent,
|
||||
0.5,
|
||||
)
|
||||
else: %QuotaProgressBar.value = quota_progression_percent
|
||||
if with_animation:
|
||||
get_tree().create_tween().tween_property(
|
||||
%QuotaProgressBar,
|
||||
"value",
|
||||
objective_progression_percent,
|
||||
0.5,
|
||||
)
|
||||
else: %QuotaProgressBar.value = objective_progression_percent
|
||||
|
||||
func _on_plant_gaining_score(plant: Plant, amount : int):
|
||||
for i in range(amount):
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
for i in range(amount):
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
|
||||
spawn_score_particle(
|
||||
plant.global_position - camera.global_position + screen_size / 2,
|
||||
%QuotaProgressBar.global_position + %QuotaProgressBar.size / 2,
|
||||
0.8
|
||||
)
|
||||
spawn_score_particle(
|
||||
plant.global_position - camera.global_position + screen_size / 2,
|
||||
%QuotaProgressBar.global_position + %QuotaProgressBar.size / 2,
|
||||
0.8
|
||||
)
|
||||
|
||||
await get_tree().create_timer(0.3 / max(1,i)).timeout
|
||||
await get_tree().create_timer(0.3 / max(1,i)).timeout
|
||||
|
||||
func spawn_score_particle(
|
||||
from_position,
|
||||
to_position,
|
||||
duration
|
||||
from_position,
|
||||
to_position,
|
||||
duration
|
||||
):
|
||||
var sprite_particle = Sprite2D.new()
|
||||
sprite_particle.texture = SCORE_ICON
|
||||
%ScoreParticles.add_child(sprite_particle)
|
||||
sprite_particle.position = from_position
|
||||
var sprite_particle = Sprite2D.new()
|
||||
sprite_particle.texture = SCORE_ICON
|
||||
%ScoreParticles.add_child(sprite_particle)
|
||||
sprite_particle.position = from_position
|
||||
|
||||
var tween = get_tree().create_tween()
|
||||
|
||||
tween.set_trans(Tween.TransitionType.TRANS_SPRING)
|
||||
|
||||
tween.tween_property(
|
||||
sprite_particle,
|
||||
"position",
|
||||
to_position,
|
||||
duration
|
||||
)
|
||||
var tween = get_tree().create_tween()
|
||||
|
||||
tween.set_trans(Tween.TransitionType.TRANS_SPRING)
|
||||
|
||||
tween.tween_property(
|
||||
sprite_particle,
|
||||
"position",
|
||||
to_position,
|
||||
duration
|
||||
)
|
||||
|
||||
|
||||
await tween.finished
|
||||
sprite_particle.queue_free()
|
||||
await tween.finished
|
||||
sprite_particle.queue_free()
|
||||
|
||||
|
||||
func _on_player_action_tried_without_energy():
|
||||
$AnimationPlayer.play("no_energy_left")
|
||||
|
||||
func _on_pause_pressed():
|
||||
Pause.pause = true
|
||||
$AnimationPlayer.play("no_energy_left")
|
||||
|
||||
func _on_player_upgraded():
|
||||
$EffectAnimation.play("upgrade")
|
||||
$EffectAnimation.play("upgrade")
|
||||
|
||||
func _on_planet_pass_day_started(planet):
|
||||
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
|
||||
$PassDayAnimation.play("pass_day")
|
||||
await $PassDayAnimation.animation_finished
|
||||
$PassDayAnimation.speed_scale = 1
|
||||
|
||||
func _on_planet_new_quota_started(planet_data : PlanetData):
|
||||
planet_update(planet_data)
|
||||
await quota_reward.reward_chosen
|
||||
announce_quota(planet_data)
|
||||
planet_data.is_quota_announced = true
|
||||
|
||||
|
||||
func announce_quota(planet_data : PlanetData):
|
||||
%Announce.announce(
|
||||
tr("NEW_QUOTA"),
|
||||
tr("REACH_%d_GARDEN_SCORE_BEFORE_%d_DAYS") % [planet_data.get_quota_score(), planet_data.get_quota_duration()]
|
||||
)
|
||||
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
|
||||
$PassDayAnimation.play("pass_day")
|
||||
await $PassDayAnimation.animation_finished
|
||||
$PassDayAnimation.speed_scale = 1
|
||||
|
||||
func _on_planet_pass_day_ended(planet:Planet):
|
||||
if planet.data.quota_days == 1:
|
||||
%Announce.announce(
|
||||
tr("LAST_DAY_FOR_REACHING_QUOTA"),
|
||||
tr("%d_GARDEN_SCORE_LEFT") % [planet.data.get_quota_score() - planet.garden.get_score()],
|
||||
Announce.RED_COLOR
|
||||
)
|
||||
if planet.data.charges == 1:
|
||||
%Announce.announce(
|
||||
tr("LAST_RECHARGE"),
|
||||
tr("%d_GARDEN_SCORE_LEFT") % [planet.data.objective - planet.garden.get_score()],
|
||||
Announce.RED_COLOR
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://fh3dsuvn5h78"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_ga3ae"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_ga3ae"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsgmxvuphn73c" path="res://common/icons/arrow-narrow-down.svg" id="2_kc1j1"]
|
||||
[ext_resource type="Script" uid="uid://r6hgefyycute" path="res://gui/game/tutorial/in_game_indicator/scripts/in_game_indicator.gd" id="2_kij5i"]
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ class_name InGameBaseIndicator
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
setup(tr("GARDEN"))
|
||||
follow_game_position(GameInfo.game_data.current_planet_data.garden_size/2)
|
||||
follow_game_position(Planet.CHUNK_SIZE / 2. * Vector2.ONE)
|
||||
|
||||
func _process(_delta):
|
||||
visible = player and (
|
||||
player.global_position.x < 0
|
||||
or player.global_position.x > GameInfo.game_data.current_planet_data.garden_size.x
|
||||
or player.global_position.x > Planet.CHUNK_SIZE
|
||||
or player.global_position.y < 0
|
||||
or player.global_position.y > GameInfo.game_data.current_planet_data.garden_size.y
|
||||
or player.global_position.y > Planet.CHUNK_SIZE
|
||||
)
|
||||
update()
|
||||
|
||||
@@ -17,51 +17,51 @@ var arrow_right : Texture = preload("res://common/icons/arrow-narrow-right.svg")
|
||||
var arrow_left : Texture = preload("res://common/icons/arrow-narrow-left.svg")
|
||||
|
||||
func setup(text : String):
|
||||
%Label.text = text
|
||||
%Label.text = text
|
||||
|
||||
func follow_game_position(game_position : Vector2):
|
||||
following_game_position = game_position
|
||||
following_type = FollowingType.GAME_POS
|
||||
following_game_position = game_position
|
||||
following_type = FollowingType.GAME_POS
|
||||
|
||||
func follow_screen_position(screen_position : Vector2):
|
||||
following_screen_position = screen_position
|
||||
following_type = FollowingType.SCREEN_POS
|
||||
following_screen_position = screen_position
|
||||
following_type = FollowingType.SCREEN_POS
|
||||
|
||||
func follow_entity(entity : Node2D):
|
||||
following_entity = entity
|
||||
following_type = FollowingType.ENTITY
|
||||
following_entity = entity
|
||||
following_type = FollowingType.ENTITY
|
||||
|
||||
func _process(_d):
|
||||
show()
|
||||
update()
|
||||
show()
|
||||
update()
|
||||
|
||||
func update():
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
|
||||
var abs_position : Vector2 = following_screen_position
|
||||
if following_type == FollowingType.GAME_POS:
|
||||
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
elif following_type == FollowingType.ENTITY and following_entity:
|
||||
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
var abs_position : Vector2 = following_screen_position
|
||||
if following_type == FollowingType.GAME_POS:
|
||||
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
elif following_type == FollowingType.ENTITY and following_entity:
|
||||
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
|
||||
position = Vector2(
|
||||
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
|
||||
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
|
||||
)
|
||||
position = Vector2(
|
||||
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
|
||||
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
|
||||
)
|
||||
|
||||
var arrow_texture : Texture = arrow_down
|
||||
if abs_position.y < 0:
|
||||
arrow_texture = arrow_up
|
||||
if abs_position.x < 0 :
|
||||
arrow_texture = arrow_left
|
||||
if abs_position.x > screen_size.x :
|
||||
arrow_texture = arrow_right
|
||||
position.x -= size.x
|
||||
if abs_position.y > screen_size.y :
|
||||
arrow_texture = arrow_down
|
||||
position.y -= size.y
|
||||
var arrow_texture : Texture = arrow_down
|
||||
if abs_position.y < 0:
|
||||
arrow_texture = arrow_up
|
||||
if abs_position.x < 0 :
|
||||
arrow_texture = arrow_left
|
||||
if abs_position.x > screen_size.x :
|
||||
arrow_texture = arrow_right
|
||||
position.x -= size.x
|
||||
if abs_position.y > screen_size.y :
|
||||
arrow_texture = arrow_down
|
||||
position.y -= size.y
|
||||
|
||||
|
||||
%Arrow.texture = arrow_texture
|
||||
|
||||
%Arrow.texture = arrow_texture
|
||||
|
||||
@@ -84,7 +84,6 @@ class DigSeedStep extends Step:
|
||||
var player_tile = Math.get_tile_from_pos(p.global_position)
|
||||
|
||||
while closest_seed == null and actual_distance < limit_distance:
|
||||
print(player_tile)
|
||||
for x in range(actual_distance):
|
||||
for y in range(actual_distance):
|
||||
var coord = Vector2i(x,y) - Vector2i.ONE * floori(actual_distance/2.) + player_tile
|
||||
@@ -134,7 +133,6 @@ class PlantSeedStep extends Step:
|
||||
var player_tile = Math.get_tile_from_pos(p.global_position)
|
||||
|
||||
while closest_decontamination == null and actual_distance < limit_distance:
|
||||
print(player_tile)
|
||||
for x in range(actual_distance):
|
||||
for y in range(actual_distance):
|
||||
var coord = Vector2i(x,y) - Vector2i.ONE * floori(actual_distance/2.) + player_tile
|
||||
|
||||
@@ -13,7 +13,7 @@ func win(planet : Planet):
|
||||
func _on_restart_pressed():
|
||||
GameInfo.game_data.reset_all()
|
||||
get_tree().paused = false
|
||||
get_tree().change_scene_to_file(game_scene_path)
|
||||
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://v41hfc7haaye"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_cl67j"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_cl67j"]
|
||||
[ext_resource type="Script" uid="uid://b3wuxv04clyed" path="res://gui/game/win/scripts/win.gd" id="1_sehw2"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_0b3c6"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_0b3c6"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_sehw2"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_0b3c6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://common/icons/rotate.svg" id="4_8p3aj"]
|
||||
|
||||
Reference in New Issue
Block a user