From 3d0104ed4a75c25e98b74906767ab8c2fc45522e Mon Sep 17 00:00:00 2001 From: Zacharie Guet Date: Fri, 22 Aug 2025 12:22:24 +0200 Subject: [PATCH] #46 ajout d'une borne de recharge et changements mineurs du gameplay --- .../assets/sprites/recharge_station.svg | 88 +++++++++ .../sprites/recharge_station.svg.import | 37 ++++ .../recharge_station/recharge_station.tscn | 23 +++ .../scripts/recharge_station.gd | 13 ++ .../scripts/recharge_station.gd.uid | 1 + .../interactables/scripts/interactable.gd | 3 - entities/plants/resources/plants/default.tres | 4 +- entities/plants/resources/plants/maias.tres | 11 +- entities/plants/scripts/plant.gd | 2 +- entities/player/scripts/player.gd | 24 +-- game.tscn | 19 +- gui/game/game_gui.tscn | 181 ++++-------------- gui/game/pause/pause.tscn | 6 +- gui/game/scripts/game_gui.gd | 18 +- gui/game/win/win.tscn | 6 +- gui/menu/assets/icons/users-group.svg | 1 + gui/menu/assets/icons/users-group.svg.import | 37 ++++ gui/{game => }/ressources/Tablette info.png | Bin .../ressources/Tablette info.png.import | 6 +- gui/{game => }/ressources/default_theme.tres | 2 +- .../ressources/fonts/AtomicMd-3zXDZ.ttf | Bin .../fonts/AtomicMd-3zXDZ.ttf.import | 6 +- .../ressources/fonts/spincycle_3d_ot.otf | Bin .../fonts/spincycle_3d_ot.otf.import | 6 +- .../ressources/fonts/spincycle_ot.otf | Bin .../ressources/fonts/spincycle_ot.otf.import | 6 +- .../title_label_settings.tres} | 2 +- project.godot | 2 +- root.tscn | 111 ++++++++--- stages/terrain/planet/scripts/planet.gd | 31 ++- 30 files changed, 400 insertions(+), 246 deletions(-) create mode 100644 entities/interactables/recharge_station/assets/sprites/recharge_station.svg create mode 100644 entities/interactables/recharge_station/assets/sprites/recharge_station.svg.import create mode 100644 entities/interactables/recharge_station/recharge_station.tscn create mode 100644 entities/interactables/recharge_station/scripts/recharge_station.gd create mode 100644 entities/interactables/recharge_station/scripts/recharge_station.gd.uid create mode 100644 gui/menu/assets/icons/users-group.svg create mode 100644 gui/menu/assets/icons/users-group.svg.import rename gui/{game => }/ressources/Tablette info.png (100%) rename gui/{game => }/ressources/Tablette info.png.import (70%) rename gui/{game => }/ressources/default_theme.tres (96%) rename gui/{game => }/ressources/fonts/AtomicMd-3zXDZ.ttf (100%) rename gui/{game => }/ressources/fonts/AtomicMd-3zXDZ.ttf.import (66%) rename gui/{game => }/ressources/fonts/spincycle_3d_ot.otf (100%) rename gui/{game => }/ressources/fonts/spincycle_3d_ot.otf.import (66%) rename gui/{game => }/ressources/fonts/spincycle_ot.otf (100%) rename gui/{game => }/ressources/fonts/spincycle_ot.otf.import (67%) rename gui/{game/ressources/default_label_settings.tres => ressources/title_label_settings.tres} (76%) diff --git a/entities/interactables/recharge_station/assets/sprites/recharge_station.svg b/entities/interactables/recharge_station/assets/sprites/recharge_station.svg new file mode 100644 index 0000000..47cc0c2 --- /dev/null +++ b/entities/interactables/recharge_station/assets/sprites/recharge_station.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + diff --git a/entities/interactables/recharge_station/assets/sprites/recharge_station.svg.import b/entities/interactables/recharge_station/assets/sprites/recharge_station.svg.import new file mode 100644 index 0000000..c6f72ad --- /dev/null +++ b/entities/interactables/recharge_station/assets/sprites/recharge_station.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c82ljr3in67am" +path="res://.godot/imported/recharge_station.svg-e388da7bbc5335a093731cd3d5c6eb67.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://entities/interactables/recharge_station/assets/sprites/recharge_station.svg" +dest_files=["res://.godot/imported/recharge_station.svg-e388da7bbc5335a093731cd3d5c6eb67.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/entities/interactables/recharge_station/recharge_station.tscn b/entities/interactables/recharge_station/recharge_station.tscn new file mode 100644 index 0000000..0e597c8 --- /dev/null +++ b/entities/interactables/recharge_station/recharge_station.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=4 format=3 uid="uid://d324mlmgls4fs"] + +[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/recharge_station/scripts/recharge_station.gd" id="1_2ffjo"] +[ext_resource type="Texture2D" uid="uid://c82ljr3in67am" path="res://entities/interactables/recharge_station/assets/sprites/recharge_station.svg" id="2_58ax0"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"] +radius = 15.0 +height = 72.0 + +[node name="RechargeStation" type="Area2D"] +modulate = Color(0.615686, 0.501961, 0.270588, 1) +script = ExtResource("1_2ffjo") +metadata/_custom_type_script = "uid://dyprcd68fjstf" + +[node name="RechargeStation" type="Sprite2D" parent="."] +position = Vector2(0, -17) +scale = Vector2(0.3, 0.3) +texture = ExtResource("2_58ax0") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(1, -1) +rotation = -1.5708 +shape = SubResource("CapsuleShape2D_bjhct") diff --git a/entities/interactables/recharge_station/scripts/recharge_station.gd b/entities/interactables/recharge_station/scripts/recharge_station.gd new file mode 100644 index 0000000..736d13d --- /dev/null +++ b/entities/interactables/recharge_station/scripts/recharge_station.gd @@ -0,0 +1,13 @@ +extends Interactable +class_name RechargeStation + +var planet : Planet # mis à jour par la classe Planet + +func interact(_p: Player) -> bool: + + planet.pass_day() + + return true + +func interact_text(): + return "Recharge" \ No newline at end of file diff --git a/entities/interactables/recharge_station/scripts/recharge_station.gd.uid b/entities/interactables/recharge_station/scripts/recharge_station.gd.uid new file mode 100644 index 0000000..5497923 --- /dev/null +++ b/entities/interactables/recharge_station/scripts/recharge_station.gd.uid @@ -0,0 +1 @@ +uid://bsrn3gd2a532q diff --git a/entities/interactables/scripts/interactable.gd b/entities/interactables/scripts/interactable.gd index 60eb75b..71e84a1 100644 --- a/entities/interactables/scripts/interactable.gd +++ b/entities/interactables/scripts/interactable.gd @@ -6,9 +6,6 @@ var available : bool = true func can_interact(_p : Player) -> bool: return true -func interact_requirement_text() -> String: - return "" - func interact(_p : Player) -> bool: printerr("Interact function called on abstract Interactable class") return false diff --git a/entities/plants/resources/plants/default.tres b/entities/plants/resources/plants/default.tres index e204786..4968e5a 100644 --- a/entities/plants/resources/plants/default.tres +++ b/entities/plants/resources/plants/default.tres @@ -9,7 +9,7 @@ [sub_resource type="Resource" id="Resource_q68uy"] script = ExtResource("2_cky1j") -impact_radius = 100 +impact_radius = 150 metadata/_custom_type_script = "uid://cgscbuxe4dawb" [sub_resource type="AtlasTexture" id="AtlasTexture_qt76e"] @@ -19,7 +19,7 @@ region = Rect2(1140, 345, 141, 128) [resource] script = ExtResource("1_moyj3") name = "Chardi" -description = "This plant reduce contamination around when it becomes mature." +description = "This plant remove a lot of contamination around when it becomes mature." growing_time = 1 seed_texture = SubResource("AtlasTexture_qt76e") planted_texture = ExtResource("4_2s6re") diff --git a/entities/plants/resources/plants/maias.tres b/entities/plants/resources/plants/maias.tres index 7b10934..ee7371c 100644 --- a/entities/plants/resources/plants/maias.tres +++ b/entities/plants/resources/plants/maias.tres @@ -1,11 +1,17 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=7 format=3 uid="uid://dsctivn1vrem2"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://dsctivn1vrem2"] [ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_eqtut"] [ext_resource type="Texture2D" uid="uid://dwr3c6r6piwaa" path="res://entities/plants/assets/sprites/maias/growing.png" id="1_vyplc"] +[ext_resource type="Script" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_vyplc"] [ext_resource type="Texture2D" uid="uid://d3apfwbqsg5ha" path="res://entities/plants/assets/sprites/maias/mature.png" id="3_pi4ie"] [ext_resource type="Texture2D" uid="uid://cpx7bkrvttasr" path="res://entities/plants/assets/sprites/maias/planted.png" id="4_iqcy2"] [ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_mwrj8"] +[sub_resource type="Resource" id="Resource_q4pje"] +script = ExtResource("2_vyplc") +impact_radius = 20 +metadata/_custom_type_script = "uid://cgscbuxe4dawb" + [sub_resource type="AtlasTexture" id="AtlasTexture_sri3b"] atlas = ExtResource("6_mwrj8") region = Rect2(1697, 331, 125, 158) @@ -13,12 +19,13 @@ region = Rect2(1697, 331, 125, 158) [resource] script = ExtResource("1_eqtut") name = "Maias" -description = "This gorgeous flower has no effect, but produce a lot of seeds." +description = "This gorgeous flower produce a lot of seeds." growing_time = 1 seed_texture = SubResource("AtlasTexture_sri3b") planted_texture = ExtResource("4_iqcy2") growing_texture = ExtResource("1_vyplc") mature_texture = ExtResource("3_pi4ie") +mature_effect = SubResource("Resource_q4pje") harvest_types_path = Array[String](["uid://b04vho33bl52b", "uid://dsctivn1vrem2"]) harvest_number = Array[int]([3, 4]) metadata/_custom_type_script = "uid://jnye5pe1bgqw" diff --git a/entities/plants/scripts/plant.gd b/entities/plants/scripts/plant.gd index a0d3091..18e84e9 100644 --- a/entities/plants/scripts/plant.gd +++ b/entities/plants/scripts/plant.gd @@ -4,7 +4,7 @@ class_name Plant const PLANT_AREA_WIDTH = 20 const HARVESTED_SEED_POSITION_RANGE = 100 -const RANDOM_MAX_GROW_INTERVAL = 0.4 +const RANDOM_MAX_GROW_INTERVAL = Planet.PASS_DAY_ANIMATION_TIME/2. - 0.1 const SPRITE_SCENE : PackedScene = preload("res://entities/plants/plant_sprite.tscn") diff --git a/entities/player/scripts/player.gd b/entities/player/scripts/player.gd index a834871..16867c0 100644 --- a/entities/player/scripts/player.gd +++ b/entities/player/scripts/player.gd @@ -48,23 +48,22 @@ func _ready(): Pointer.player = self # Méthode déclenchée par la classe planet -func _pass_day(): - energy = max_energy +func _start_pass_day(): + controlling_player = false target_interactable = null +# Méthode déclenchée par la classe planet +func _pass_day(): + recharge() + +# Méthode déclenchée par la classe planet +func _end_pass_day(): + controlling_player = true + func _process(_delta): get_input() move_and_slide() -func _on_root_gui_day_pass_pressed(): - controlling_player = false - -func _on_root_gui_day_pass_finished(): - controlling_player = true - -func _on_root_gui_game_click(): - try_use_item() - func _on_inventory_updated(_inventory: Inventory): emit_signal("player_updated", self) @@ -162,6 +161,9 @@ func upgrade(): energy += 1 upgraded.emit() +func recharge(amount : int = max_energy): + energy = min(energy + amount, max_energy) + func play_sfx(sound : String): match sound: "dig": diff --git a/game.tscn b/game.tscn index b81f209..81cff71 100644 --- a/game.tscn +++ b/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=20 format=3 uid="uid://d28cp7a21kwou"] +[gd_scene load_steps=21 format=3 uid="uid://d28cp7a21kwou"] [ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="1_iotsf"] [ext_resource type="PackedScene" uid="uid://csiacsndm62ll" path="res://gui/game/pause/pause.tscn" id="2_215e1"] @@ -9,6 +9,7 @@ [ext_resource type="Resource" uid="uid://ddqalo1k30i5x" path="res://common/inventory/resources/items/default_shovel.tres" id="6_lc2xo"] [ext_resource type="PackedScene" uid="uid://bkwh1ntvgkkrt" path="res://entities/interactables/compost/compost.tscn" id="7_215e1"] [ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://common/inventory/scripts/item.gd" id="7_rvswv"] +[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/recharge_station/recharge_station.tscn" id="8_7sc4i"] [ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="8_boyg6"] [ext_resource type="Resource" uid="uid://b04vho33bl52b" path="res://entities/plants/resources/plants/default.tres" id="9_e36ub"] [ext_resource type="Script" uid="uid://bypjcvlc15gsm" path="res://common/inventory/scripts/items/seed.gd" id="10_hb5m1"] @@ -23,7 +24,7 @@ region = Rect2(1140, 345, 141, 128) script = ExtResource("10_hb5m1") plant_type = ExtResource("9_e36ub") name = "Chardi" -description = "This plant reduce contamination around when it becomes mature." +description = "This plant remove a lot of contamination around when it becomes mature." icon = SubResource("AtlasTexture_qt76e") metadata/_custom_type_script = "uid://bypjcvlc15gsm" @@ -31,7 +32,7 @@ metadata/_custom_type_script = "uid://bypjcvlc15gsm" script = ExtResource("10_hb5m1") plant_type = ExtResource("9_e36ub") name = "Chardi" -description = "This plant reduce contamination around when it becomes mature." +description = "This plant remove a lot of contamination around when it becomes mature." icon = SubResource("AtlasTexture_qt76e") metadata/_custom_type_script = "uid://bypjcvlc15gsm" @@ -43,7 +44,7 @@ region = Rect2(1697, 331, 125, 158) script = ExtResource("10_hb5m1") plant_type = ExtResource("11_x5p1p") name = "Maias" -description = "This gorgeous flower has no effect, but produce a lot of seeds." +description = "This gorgeous flower produce a lot of seeds." icon = SubResource("AtlasTexture_sri3b") metadata/_custom_type_script = "uid://bypjcvlc15gsm" @@ -76,6 +77,9 @@ metadata/_custom_type_script = "uid://dedg615xudpoq" [node name="Compost" parent="Entities" instance=ExtResource("7_215e1")] position = Vector2(3, 458) +[node name="RechargeStation" parent="Entities" instance=ExtResource("8_7sc4i")] +position = Vector2(0, -154) + [node name="Planet" parent="." node_paths=PackedStringArray("import_entities_from_node") instance=ExtResource("6_e8heu")] loot_items = Array[ExtResource("7_rvswv")]([SubResource("Resource_lc2xo"), SubResource("Resource_215e1"), SubResource("Resource_7sc4i")]) import_entities_from_node = NodePath("../Entities") @@ -84,15 +88,12 @@ import_entities_from_node = NodePath("../Entities") position = Vector2(2.22, 0) following = NodePath("../Entities/Player") -[connection signal="day_pass_finished" from="CanvasLayer/RootGui" to="Entities/Player" method="_on_root_gui_day_pass_finished"] -[connection signal="day_pass_finished" from="CanvasLayer/RootGui" to="Planet" method="_on_root_gui_day_pass_finished"] -[connection signal="day_pass_pressed" from="CanvasLayer/RootGui" to="Entities/Player" method="_on_root_gui_day_pass_pressed"] -[connection signal="day_pass_proceed" from="CanvasLayer/RootGui" to="Planet" method="_on_root_gui_day_pass_proceed"] -[connection signal="game_click" from="CanvasLayer/RootGui" to="Entities/Player" method="_on_root_gui_game_click"] [connection signal="pause_asked" from="CanvasLayer/RootGui" to="CanvasLayer/Pause" method="_on_root_gui_pause_asked"] [connection signal="action_not_permitted" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_action_not_permitted"] [connection signal="action_tried_without_energy" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_action_tried_without_energy"] [connection signal="player_updated" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_updated"] [connection signal="upgraded" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_upgraded"] [connection signal="day_limit_exceed" from="Planet" to="CanvasLayer/Win" method="_on_planet_day_limit_exceed"] +[connection signal="pass_day_ended" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_pass_day_ended"] +[connection signal="pass_day_started" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_pass_day_started"] [connection signal="planet_updated" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_updated"] diff --git a/gui/game/game_gui.tscn b/gui/game/game_gui.tscn index 572e5c6..ca9f934 100644 --- a/gui/game/game_gui.tscn +++ b/gui/game/game_gui.tscn @@ -1,13 +1,13 @@ -[gd_scene load_steps=22 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"] +[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_nq5i2"] [ext_resource type="Texture2D" uid="uid://cm3ehinvvj52i" path="res://gui/game/assets/texture/Interface sans boutons.png" id="3_n4kem"] [ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/game/assets/icons/bolt.svg" id="4_k4juk"] -[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="4_ujg5r"] +[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_ujg5r"] [ext_resource type="Texture2D" uid="uid://c2pgaklnj5w3d" path="res://gui/game/assets/texture/Tablette info.png" id="6_fovlv"] [ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="7_n4kem"] -[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="8_n4kem"] +[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="8_n4kem"] [ext_resource type="Texture2D" uid="uid://b5cuxgisrsfgt" path="res://gui/game/pause/assets/icons/player-pause.svg" id="9_2wykm"] [sub_resource type="AtlasTexture" id="AtlasTexture_ek73b"] @@ -26,72 +26,48 @@ length = 0.001 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("RechargeFade:color") +tracks/0/path = NodePath("PassDayFade:color") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [Color(0, 0, 0, 0)] +"values": [Color(0.0627451, 0.0588235, 0.168627, 0)] } tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("RechargeFade:visible") +tracks/1/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_left") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), -"update": 1, -"values": [false] +"update": 0, +"values": [-44.0] } tracks/2/type = "value" tracks/2/imported = false tracks/2/enabled = true -tracks/2/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_left") +tracks/2/path = NodePath("Effect:modulate") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [-44.0] +"values": [Color(1, 1, 1, 0)] } tracks/3/type = "value" tracks/3/imported = false tracks/3/enabled = true -tracks/3/path = NodePath("Effect:visible") +tracks/3/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_bottom") 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] } @@ -114,22 +90,10 @@ tracks/0/keys = { tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("Effect:visible") +tracks/1/path = NodePath("Effect:modulate") 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, @@ -142,80 +106,29 @@ length = 0.5 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("Effect:visible") +tracks/0/path = NodePath("Effect:modulate") 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 = 1 -tracks/1/loop_wrap = true -tracks/1/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"] -resource_name = "recharge_fade_in" +[sub_resource type="Animation" id="Animation_ykapk"] +resource_name = "pass_day" tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("RechargeFade:color") -tracks/0/interp = 1 +tracks/0/path = NodePath("PassDayFade:color") +tracks/0/interp = 2 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 1), -"transitions": PackedFloat32Array(1, 1), +"times": PackedFloat32Array(0, 0.4, 0.6, 1), +"transitions": PackedFloat32Array(1, 1, 1, 1), "update": 0, -"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("RechargeFade:visible") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [true] -} - -[sub_resource type="Animation" id="Animation_fovlv"] -resource_name = "recharge_fade_out" -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("RechargeFade:color") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0.166667, 1), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("RechargeFade:visible") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(1), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [false] +"values": [Color(0.0627451, 0.0588235, 0.168627, 0), Color(0.0627451, 0.0588235, 0.168627, 1), Color(0.0627451, 0.0588235, 0.168627, 1), Color(0.0627451, 0.0588235, 0.168627, 0)] } [sub_resource type="Animation" id="Animation_2wykm"] @@ -224,34 +137,22 @@ 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/path = NodePath("Effect:modulate") +tracks/0/interp = 2 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 = { +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_bottom") +tracks/1/interp = 2 +tracks/1/loop_wrap = true +tracks/1/keys = { "times": PackedFloat32Array(0, 0.233333, 0.5), "transitions": PackedFloat32Array(1, 1, 1), "update": 0, @@ -263,8 +164,7 @@ _data = { &"RESET": SubResource("Animation_iyvkh"), &"no_energy_left": SubResource("Animation_n4kem"), &"not_permitted": SubResource("Animation_id0t5"), -&"recharge_fade_in": SubResource("Animation_k4juk"), -&"recharge_fade_out": SubResource("Animation_fovlv"), +&"pass_day": SubResource("Animation_ykapk"), &"upgrade": SubResource("Animation_2wykm") } @@ -360,16 +260,6 @@ label_settings = ExtResource("4_ujg5r") horizontal_alignment = 1 vertical_alignment = 1 -[node name="DayPass" type="Button" parent="MarginContainer"] -layout_mode = 2 -size_flags_horizontal = 8 -size_flags_vertical = 8 -focus_mode = 0 -mouse_filter = 1 -theme = ExtResource("2_nq5i2") -text = "Recharge" -icon = ExtResource("4_k4juk") - [node name="ItemInfo" type="TextureRect" parent="MarginContainer"] unique_name_in_owner = true custom_minimum_size = Vector2(0, 300) @@ -444,16 +334,16 @@ focus_mode = 0 mouse_filter = 1 icon = ExtResource("9_2wykm") -[node name="RechargeFade" type="ColorRect" parent="."] +[node name="PassDayFade" type="ColorRect" parent="."] physics_interpolation_mode = 0 -visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -color = Color(0, 0, 0, 0) +mouse_filter = 2 +color = Color(0.0627451, 0.0588235, 0.168627, 0) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] libraries = { @@ -466,7 +356,7 @@ offset_right = 40.0 offset_bottom = 40.0 [node name="Effect" type="TextureRect" parent="."] -visible = false +modulate = Color(1, 1, 1, 0) layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -476,5 +366,4 @@ grow_vertical = 2 mouse_filter = 2 texture = SubResource("GradientTexture2D_id0t5") -[connection signal="pressed" from="MarginContainer/DayPass" to="." method="_on_day_pass_pressed"] [connection signal="pressed" from="MarginContainer/TopRightContent/Pause" to="." method="_on_pause_pressed"] diff --git a/gui/game/pause/pause.tscn b/gui/game/pause/pause.tscn index c6d16d2..a9c2c2d 100644 --- a/gui/game/pause/pause.tscn +++ b/gui/game/pause/pause.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=9 format=3 uid="uid://csiacsndm62ll"] -[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="1_51ks3"] +[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.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="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="2_8d1kg"] -[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="3_0pdto"] +[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_8d1kg"] +[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_0pdto"] [ext_resource type="Texture2D" uid="uid://vmsn54d1ptih" path="res://gui/game/pause/assets/icons/player-play.svg" id="5_apjlw"] [ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://gui/game/pause/assets/icons/rotate.svg" id="6_58dya"] [ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://gui/game/pause/assets/icons/logout.svg" id="7_yj6f1"] diff --git a/gui/game/scripts/game_gui.gd b/gui/game/scripts/game_gui.gd index 4877df7..4792e64 100644 --- a/gui/game/scripts/game_gui.gd +++ b/gui/game/scripts/game_gui.gd @@ -1,10 +1,6 @@ extends Control class_name GameGui -signal game_click -signal day_pass_pressed -signal day_pass_proceed -signal day_pass_finished signal pause_asked func _on_player_updated(player:Player): @@ -19,16 +15,10 @@ func _on_player_updated(player:Player): %ItemDesc.text = item.description func _on_day_pass_pressed(): - day_pass_pressed.emit() - $AnimationPlayer.play("recharge_fade_in") + await $AnimationPlayer.animation_finished - day_pass_proceed.emit() $AnimationPlayer.play("recharge_fade_out") await $AnimationPlayer.animation_finished - day_pass_finished.emit() - -func _on_game_action_button_down(): - game_click.emit() func _on_planet_updated(planet:Planet): %DayCount.text = "Day " + str(planet.day) @@ -49,3 +39,9 @@ func _on_player_upgraded(): func _on_player_action_not_permitted(): $AnimationPlayer.play("not_permitted") + +func _on_planet_pass_day_started(planet): + $AnimationPlayer.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME) + $AnimationPlayer.play("pass_day") + await $AnimationPlayer.animation_finished + $AnimationPlayer.speed_scale = 1 diff --git a/gui/game/win/win.tscn b/gui/game/win/win.tscn index 992a7ba..4ed02d7 100644 --- a/gui/game/win/win.tscn +++ b/gui/game/win/win.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=8 format=3 uid="uid://v41hfc7haaye"] -[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="1_cl67j"] +[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.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="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="2_sehw2"] -[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="3_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://gui/game/pause/assets/icons/rotate.svg" id="4_8p3aj"] [ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://gui/game/pause/assets/icons/logout.svg" id="5_j3wid"] diff --git a/gui/menu/assets/icons/users-group.svg b/gui/menu/assets/icons/users-group.svg new file mode 100644 index 0000000..ce26412 --- /dev/null +++ b/gui/menu/assets/icons/users-group.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/gui/menu/assets/icons/users-group.svg.import b/gui/menu/assets/icons/users-group.svg.import new file mode 100644 index 0000000..41a5fa7 --- /dev/null +++ b/gui/menu/assets/icons/users-group.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b38hdpsvqcwg8" +path="res://.godot/imported/users-group.svg-65aad5cfa47be548675b81fab7ab9db6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://gui/menu/assets/icons/users-group.svg" +dest_files=["res://.godot/imported/users-group.svg-65aad5cfa47be548675b81fab7ab9db6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/gui/game/ressources/Tablette info.png b/gui/ressources/Tablette info.png similarity index 100% rename from gui/game/ressources/Tablette info.png rename to gui/ressources/Tablette info.png diff --git a/gui/game/ressources/Tablette info.png.import b/gui/ressources/Tablette info.png.import similarity index 70% rename from gui/game/ressources/Tablette info.png.import rename to gui/ressources/Tablette info.png.import index 5fe51fd..c2c6341 100644 --- a/gui/game/ressources/Tablette info.png.import +++ b/gui/ressources/Tablette info.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://qx75h1k3wmm1" -path="res://.godot/imported/Tablette info.png-b4fbef928a773f595b589d989235c266.ctex" +path="res://.godot/imported/Tablette info.png-e89cd3fdb4a303341f3bbad730de279c.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://gui/game/ressources/Tablette info.png" -dest_files=["res://.godot/imported/Tablette info.png-b4fbef928a773f595b589d989235c266.ctex"] +source_file="res://gui/ressources/Tablette info.png" +dest_files=["res://.godot/imported/Tablette info.png-e89cd3fdb4a303341f3bbad730de279c.ctex"] [params] diff --git a/gui/game/ressources/default_theme.tres b/gui/ressources/default_theme.tres similarity index 96% rename from gui/game/ressources/default_theme.tres rename to gui/ressources/default_theme.tres index 6899aab..c260647 100644 --- a/gui/game/ressources/default_theme.tres +++ b/gui/ressources/default_theme.tres @@ -1,6 +1,6 @@ [gd_resource type="Theme" load_steps=5 format=3 uid="uid://bgcmd213j6gk1"] -[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="1_hv6r3"] +[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="1_hv6r3"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hv6r3"] bg_color = Color(0.976471, 0.741176, 0.4, 1) diff --git a/gui/game/ressources/fonts/AtomicMd-3zXDZ.ttf b/gui/ressources/fonts/AtomicMd-3zXDZ.ttf similarity index 100% rename from gui/game/ressources/fonts/AtomicMd-3zXDZ.ttf rename to gui/ressources/fonts/AtomicMd-3zXDZ.ttf diff --git a/gui/game/ressources/fonts/AtomicMd-3zXDZ.ttf.import b/gui/ressources/fonts/AtomicMd-3zXDZ.ttf.import similarity index 66% rename from gui/game/ressources/fonts/AtomicMd-3zXDZ.ttf.import rename to gui/ressources/fonts/AtomicMd-3zXDZ.ttf.import index 03c0b50..4750024 100644 --- a/gui/game/ressources/fonts/AtomicMd-3zXDZ.ttf.import +++ b/gui/ressources/fonts/AtomicMd-3zXDZ.ttf.import @@ -3,12 +3,12 @@ importer="font_data_dynamic" type="FontFile" uid="uid://byyfovm1ha5ya" -path="res://.godot/imported/AtomicMd-3zXDZ.ttf-72972057c8e238d8e668e97b2f9f70c6.fontdata" +path="res://.godot/imported/AtomicMd-3zXDZ.ttf-0d8ee2c5d0b5b97084be121e0cf9710b.fontdata" [deps] -source_file="res://gui/game/ressources/fonts/AtomicMd-3zXDZ.ttf" -dest_files=["res://.godot/imported/AtomicMd-3zXDZ.ttf-72972057c8e238d8e668e97b2f9f70c6.fontdata"] +source_file="res://gui/ressources/fonts/AtomicMd-3zXDZ.ttf" +dest_files=["res://.godot/imported/AtomicMd-3zXDZ.ttf-0d8ee2c5d0b5b97084be121e0cf9710b.fontdata"] [params] diff --git a/gui/game/ressources/fonts/spincycle_3d_ot.otf b/gui/ressources/fonts/spincycle_3d_ot.otf similarity index 100% rename from gui/game/ressources/fonts/spincycle_3d_ot.otf rename to gui/ressources/fonts/spincycle_3d_ot.otf diff --git a/gui/game/ressources/fonts/spincycle_3d_ot.otf.import b/gui/ressources/fonts/spincycle_3d_ot.otf.import similarity index 66% rename from gui/game/ressources/fonts/spincycle_3d_ot.otf.import rename to gui/ressources/fonts/spincycle_3d_ot.otf.import index 74c23fc..d3f3376 100644 --- a/gui/game/ressources/fonts/spincycle_3d_ot.otf.import +++ b/gui/ressources/fonts/spincycle_3d_ot.otf.import @@ -3,12 +3,12 @@ importer="font_data_dynamic" type="FontFile" uid="uid://c8xf3tfnpufk3" -path="res://.godot/imported/spincycle_3d_ot.otf-21ea869159b3b8db074d7006cdac52ac.fontdata" +path="res://.godot/imported/spincycle_3d_ot.otf-f71d33fbaded9da2ba85d0eb20bfd1e1.fontdata" [deps] -source_file="res://gui/game/ressources/fonts/spincycle_3d_ot.otf" -dest_files=["res://.godot/imported/spincycle_3d_ot.otf-21ea869159b3b8db074d7006cdac52ac.fontdata"] +source_file="res://gui/ressources/fonts/spincycle_3d_ot.otf" +dest_files=["res://.godot/imported/spincycle_3d_ot.otf-f71d33fbaded9da2ba85d0eb20bfd1e1.fontdata"] [params] diff --git a/gui/game/ressources/fonts/spincycle_ot.otf b/gui/ressources/fonts/spincycle_ot.otf similarity index 100% rename from gui/game/ressources/fonts/spincycle_ot.otf rename to gui/ressources/fonts/spincycle_ot.otf diff --git a/gui/game/ressources/fonts/spincycle_ot.otf.import b/gui/ressources/fonts/spincycle_ot.otf.import similarity index 67% rename from gui/game/ressources/fonts/spincycle_ot.otf.import rename to gui/ressources/fonts/spincycle_ot.otf.import index affb9ee..d2d6484 100644 --- a/gui/game/ressources/fonts/spincycle_ot.otf.import +++ b/gui/ressources/fonts/spincycle_ot.otf.import @@ -3,12 +3,12 @@ importer="font_data_dynamic" type="FontFile" uid="uid://cpnsnrqhfkj3k" -path="res://.godot/imported/spincycle_ot.otf-27679d167ed7a37649e3338357150952.fontdata" +path="res://.godot/imported/spincycle_ot.otf-be21809daa8fde21c00f1cf664ce2342.fontdata" [deps] -source_file="res://gui/game/ressources/fonts/spincycle_ot.otf" -dest_files=["res://.godot/imported/spincycle_ot.otf-27679d167ed7a37649e3338357150952.fontdata"] +source_file="res://gui/ressources/fonts/spincycle_ot.otf" +dest_files=["res://.godot/imported/spincycle_ot.otf-be21809daa8fde21c00f1cf664ce2342.fontdata"] [params] diff --git a/gui/game/ressources/default_label_settings.tres b/gui/ressources/title_label_settings.tres similarity index 76% rename from gui/game/ressources/default_label_settings.tres rename to gui/ressources/title_label_settings.tres index 1dcc11a..37bbcd6 100644 --- a/gui/game/ressources/default_label_settings.tres +++ b/gui/ressources/title_label_settings.tres @@ -1,6 +1,6 @@ [gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://dqwayi8yjwau2"] -[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="1_w0wva"] +[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="1_w0wva"] [resource] font = ExtResource("1_w0wva") diff --git a/project.godot b/project.godot index 8b19740..dc167a9 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="Seeding Planets" config/description="Seeding planets is a survival, managment and cosy game in which you play a little gardener robot." -config/version="proto-1.1" +config/version="proto-1.2" run/main_scene="uid://c5bruelvqbm1k" config/features=PackedStringArray("4.4", "Forward Plus") config/icon="uid://df0y0s666ui4h" diff --git a/root.tscn b/root.tscn index 6edc511..73ba0b6 100644 --- a/root.tscn +++ b/root.tscn @@ -1,18 +1,20 @@ -[gd_scene load_steps=8 format=3 uid="uid://c5bruelvqbm1k"] +[gd_scene load_steps=9 format=3 uid="uid://c5bruelvqbm1k"] [ext_resource type="Script" uid="uid://c54457tbocdwk" path="res://gui/menu/scripts/menu.gd" id="1_bf3um"] [ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/planet/assets/textures/sol_gamejam_normal.png" id="2_huihk"] [ext_resource type="Texture2D" uid="uid://dcn4cq53h1qiy" path="res://stages/terrain/planet/resources/textures/sol_gamejam_fleurs_transp.png" id="3_tw3kd"] -[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="4_gd4vy"] +[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="4_gd4vy"] [ext_resource type="Texture2D" uid="uid://nx4wxpr6mk8l" path="res://gui/menu/assets/texture/SeedingPlanetsLogo.png" id="5_qw60f"] [ext_resource type="Texture2D" uid="uid://03ijmo6xlytu" path="res://gui/menu/assets/texture/abre1glow.png" id="6_eji0w"] [ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/game/assets/icons/bolt.svg" id="7_qwhpj"] +[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="8_bf3um"] [node name="Root" type="Node2D"] script = ExtResource("1_bf3um") start_scene_path = "uid://d28cp7a21kwou" [node name="CanvasLayer" type="CanvasLayer" parent="."] +process_mode = 3 [node name="Background1" type="TextureRect" parent="CanvasLayer"] z_index = -1 @@ -44,17 +46,8 @@ grow_horizontal = 2 grow_vertical = 2 theme = ExtResource("4_gd4vy") -[node name="Logo" type="TextureRect" parent="CanvasLayer/MarginContainer"] -z_index = 2 -custom_minimum_size = Vector2(500, 0) -layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 0 -texture = ExtResource("5_qw60f") -expand_mode = 5 -stretch_mode = 4 - [node name="Tree" type="TextureRect" parent="CanvasLayer/MarginContainer"] +z_index = -1 custom_minimum_size = Vector2(500, 0) layout_mode = 2 size_flags_horizontal = 4 @@ -63,15 +56,6 @@ texture = ExtResource("6_eji0w") expand_mode = 4 stretch_mode = 4 -[node name="Start" type="Button" parent="CanvasLayer/MarginContainer"] -layout_mode = 2 -size_flags_horizontal = 8 -size_flags_vertical = 8 -theme = ExtResource("4_gd4vy") -theme_override_font_sizes/font_size = 33 -text = "Start" -icon = ExtResource("7_qwhpj") - [node name="Version" type="Label" parent="CanvasLayer/MarginContainer"] unique_name_in_owner = true layout_mode = 2 @@ -79,19 +63,84 @@ size_flags_horizontal = 8 size_flags_vertical = 0 text = "Version" -[node name="Credits" type="Label" parent="CanvasLayer/MarginContainer"] +[node name="GridContainer" type="HBoxContainer" parent="CanvasLayer/MarginContainer"] layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 8 -text = "Art -Céline Ferrand / Lunarde +alignment = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/MarginContainer/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +theme_override_constants/separation = 20 +alignment = 1 + +[node name="Logo" type="TextureRect" parent="CanvasLayer/MarginContainer/GridContainer/VBoxContainer"] +z_index = 2 +custom_minimum_size = Vector2(600, 0) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 0 +texture = ExtResource("5_qw60f") +expand_mode = 5 +stretch_mode = 5 + +[node name="Start" type="Button" parent="CanvasLayer/MarginContainer/GridContainer/VBoxContainer"] +unique_name_in_owner = true +z_index = 1 +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme = ExtResource("4_gd4vy") +theme_override_font_sizes/font_size = 33 +text = "Start" +icon = ExtResource("7_qwhpj") + +[node name="Credits" type="VBoxContainer" parent="CanvasLayer/MarginContainer/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 + +[node name="ArtTitle" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"] +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("4_gd4vy") +text = "Art" +label_settings = ExtResource("8_bf3um") +horizontal_alignment = 1 + +[node name="ArtText" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"] +layout_mode = 2 +text = "Céline Ferrand / Lunarde Camille Fleury +" +horizontal_alignment = 1 -Development / Game Design -Zacharie Guet / Zink +[node name="DevTitle" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"] +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("4_gd4vy") +text = "Development / Game Design" +label_settings = ExtResource("8_bf3um") +horizontal_alignment = 1 + +[node name="DevText" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"] +layout_mode = 2 +text = "Zacharie Guet / Zink Victor Robert Jaunet / Altaezio +" +horizontal_alignment = 1 -Music -Niels / Nilou" +[node name="MusicTitle" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"] +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("4_gd4vy") +text = "Music" +label_settings = ExtResource("8_bf3um") +horizontal_alignment = 1 -[connection signal="pressed" from="CanvasLayer/MarginContainer/Start" to="." method="_on_start_pressed"] +[node name="MusicText" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"] +layout_mode = 2 +text = "Niels / Nilou" +horizontal_alignment = 1 + +[connection signal="pressed" from="CanvasLayer/MarginContainer/GridContainer/VBoxContainer/Start" to="." method="_on_start_pressed"] diff --git a/stages/terrain/planet/scripts/planet.gd b/stages/terrain/planet/scripts/planet.gd index 21e3af2..112deff 100644 --- a/stages/terrain/planet/scripts/planet.gd +++ b/stages/terrain/planet/scripts/planet.gd @@ -3,7 +3,11 @@ class_name Planet signal planet_updated(planet : Planet) signal day_limit_exceed(planet : Planet) +signal pass_day_started(planet : Planet) +signal pass_day_proceeded(planet : Planet) +signal pass_day_ended(planet : Planet) +const PASS_DAY_ANIMATION_TIME : float = 1.5 const DAY_LIMIT : int = 10 const PLANET_TEXTURE_SCALE : float = 5.0 @@ -115,11 +119,28 @@ func is_there_contamination(point : Vector2) -> bool: return terrainData.get_contamination(point) < 0.5 func pass_day(): + for e : Node2D in entityContainer.get_children(): + if e.has_method("_start_pass_day"): + e._start_pass_day() + pass_day_started.emit(self) + await get_tree().create_timer(PASS_DAY_ANIMATION_TIME/2.).timeout + + generate_loot() + pass_day_proceeded.emit(self) day += 1 for e : Node2D in entityContainer.get_children(): if e.has_method("_pass_day"): e._pass_day() - generate_loot() + + pass_day_ended.emit(self) + await get_tree().create_timer(PASS_DAY_ANIMATION_TIME/2.).timeout + for e : Node2D in entityContainer.get_children(): + if e.has_method("_end_pass_day"): + e._end_pass_day() + + decontamination_coverage = terrainData.get_decontamination_coverage() + if day + 1 > DAY_LIMIT: + day_limit_exceed.emit(self) func generate_loot(number : int = loot_number.pick_random()): for i in range(number): @@ -137,11 +158,3 @@ func generate_loot(number : int = loot_number.pick_random()): ) #endregion - -func _on_root_gui_day_pass_proceed(): - pass_day() - -func _on_root_gui_day_pass_finished(): - decontamination_coverage = terrainData.get_decontamination_coverage() - if day + 1 > DAY_LIMIT: - day_limit_exceed.emit(self)