#39 ajout d'un compost plus des ajouts mineurs de qualité de vie

This commit is contained in:
2025-08-20 15:41:27 +02:00
parent 219e8258e7
commit 2f0c5a2be4
15 changed files with 454 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=3 uid="uid://12nak7amd1uq"]
[gd_scene load_steps=21 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/game/ressources/default_theme.tres" id="2_nq5i2"]
@@ -59,6 +59,42 @@ tracks/2/keys = {
"update": 0,
"values": [-44.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Effect:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Effect:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_bottom")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [12.5]
}
[sub_resource type="Animation" id="Animation_n4kem"]
resource_name = "no_energy_left"
@@ -70,10 +106,34 @@ tracks/0/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_left")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.0666667, 0.133333, 0.2, 0.266667, 0.333333, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"times": PackedFloat32Array(0, 0.0333333, 0.1, 0.166667, 0.233333, 0.3, 0.366667, 0.433333, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [-44.0, -40.0, -44.0, -48.0, -44.0, -40.0, -44.0]
"values": [-44.0, -40.0, -44.0, -48.0, -44.0, -40.0, -44.0, -40.0, -44.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Effect:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Effect:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.266667),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(0.866667, 0.152941, 0.337255, 0), Color(0.866667, 0.152941, 0.337255, 0.392157), Color(0.866667, 0.152941, 0.337255, 0)]
}
[sub_resource type="Animation" id="Animation_k4juk"]
@@ -130,14 +190,64 @@ tracks/1/keys = {
"values": [false]
}
[sub_resource type="Animation" id="Animation_2wykm"]
resource_name = "upgrade"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Effect:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Effect:modulate")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.133333, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(0.67451, 0.52549, 0.203922, 0), Color(0.67451, 0.52549, 0.203922, 0.572549), Color(0.67451, 0.52549, 0.203922, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_bottom")
tracks/2/interp = 2
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.233333, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [12.5, -32.0, 12.5]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_n4kem"]
_data = {
&"RESET": SubResource("Animation_iyvkh"),
&"no_energy_left": SubResource("Animation_n4kem"),
&"recharge_fade_in": SubResource("Animation_k4juk"),
&"recharge_fade_out": SubResource("Animation_fovlv")
&"recharge_fade_out": SubResource("Animation_fovlv"),
&"upgrade": SubResource("Animation_2wykm")
}
[sub_resource type="Gradient" id="Gradient_2wykm"]
offsets = PackedFloat32Array(0, 0.279476, 1)
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_id0t5"]
gradient = SubResource("Gradient_2wykm")
fill = 1
fill_from = Vector2(0.5, 0.5)
[node name="RootGui" type="Control"]
layout_mode = 3
anchors_preset = 15
@@ -198,6 +308,7 @@ offset_right = 44.0
offset_bottom = 12.5
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 0
metadata/_edit_use_anchors_ = true
[node name="Icon" type="TextureRect" parent="MarginContainer/PlayerInfo/EnergyInfo"]
@@ -210,7 +321,7 @@ stretch_mode = 5
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_nq5i2")
text = "0"
text = "0/3"
label_settings = ExtResource("4_ujg5r")
horizontal_alignment = 1
vertical_alignment = 1
@@ -297,7 +408,12 @@ theme = ExtResource("2_nq5i2")
[node name="Plant" type="Label" parent="MarginContainer/AvailableActions"]
visible = false
layout_mode = 2
text = "space/click - Plant Seed"
text = "Space/Click - Plant Seed"
[node name="Interact" type="Label" parent="MarginContainer/AvailableActions"]
visible = false
layout_mode = 2
text = "E - Interact"
[node name="GetItem" type="Label" parent="MarginContainer/AvailableActions"]
visible = false
@@ -312,12 +428,12 @@ text = "E - Swap Item"
[node name="DropItem" type="Label" parent="MarginContainer/AvailableActions"]
visible = false
layout_mode = 2
text = "w - Drop Item"
text = "W - Drop Item"
[node name="UseItem" type="Label" parent="MarginContainer/AvailableActions"]
visible = false
layout_mode = 2
text = "space/click - Use Item"
text = "Space/Click - Use Item"
[node name="TopRightContent" type="HBoxContainer" parent="MarginContainer"]
layout_mode = 2
@@ -362,6 +478,17 @@ layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Effect" type="TextureRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = SubResource("GradientTexture2D_id0t5")
[connection signal="button_down" from="GameAction" to="." method="_on_game_action_button_down"]
[connection signal="pressed" from="MarginContainer/DayPass" to="." method="_on_day_pass_pressed"]
[connection signal="pressed" from="MarginContainer/TopRightContent/Pause" to="." method="_on_pause_pressed"]

View File

@@ -63,6 +63,7 @@ layout_mode = 2
text = "You are a robot who has recently arrived on a barren planet. Find and plant seeds to reduce the contamination.
You have limited energy, but can recharge when passing days.
You have 10 days to decontaminate as much as possible.
PS: You can compost seeds at the bottom of the map to upgrade max enegy.
"
horizontal_alignment = 1

View File

@@ -8,10 +8,11 @@ signal day_pass_finished
signal pause_asked
func _on_player_updated(player:Player):
%EnergyCount.text = str(player.energy)
%EnergyCount.text = str(player.energy) + "/" + str(player.max_energy)
%EnergyInfo.modulate = Color.WHITE if player.energy > 0 else Color.RED
%AvailableActions/GetItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() == null
%AvailableActions/Interact.visible = not player.closest_interactable is ItemObject and player.can_interact
%AvailableActions/SwapItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() != null
%AvailableActions/DropItem.visible = player.inventory.get_item() != null
%AvailableActions/UseItem.visible = player.inventory.get_item() and player.can_use_item and not player.inventory.get_item() is Seed
@@ -48,3 +49,7 @@ func _on_player_action_tried_without_energy():
func _on_pause_pressed():
pause_asked.emit()
func _on_player_upgraded():
$AnimationPlayer.play("upgrade")