From fb5a692cf40796d92775229c39a5bf91dc80a893 Mon Sep 17 00:00:00 2001 From: Zacharie Guet Date: Sun, 9 Nov 2025 16:53:57 +0100 Subject: [PATCH] ajout d'un indicateur de la base lors de l'exploration et changements divers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * suppression des deux dernières étapes du tutoriel * fix des particules de score * ajout du loop dans l'import de la dernière musique --- Translation/localization.csv | 1 + .../assets/morceaux/forest_phase_3.ogg.import | 6 ++--- .../scripts/in_game_base_indicator.gd | 19 +++++++++++++++ .../scripts/in_game_base_indicator.gd.uid | 1 + .../scripts/in_game_indicator.gd | 2 ++ gui/game/tutorial/scripts/tutorial.gd | 4 ++-- stages/planet_run/planet_run.tscn | 24 +++++++++++++------ stages/terrain/planet/scripts/garden.gd | 2 ++ 8 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd create mode 100644 gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd.uid diff --git a/Translation/localization.csv b/Translation/localization.csv index 1284759..db8f8a2 100644 --- a/Translation/localization.csv +++ b/Translation/localization.csv @@ -15,6 +15,7 @@ Molette : Changer l'objet en main X : Lâcher l’objet" STORY,Story,Histoire OK,Ok,Ok +GARDEN,Garden,Jardin COMMA,", ","," OR," or "," ou " PAUSE,Pause,Pause diff --git a/common/music/assets/morceaux/forest_phase_3.ogg.import b/common/music/assets/morceaux/forest_phase_3.ogg.import index 5e900ed..a898c13 100644 --- a/common/music/assets/morceaux/forest_phase_3.ogg.import +++ b/common/music/assets/morceaux/forest_phase_3.ogg.import @@ -12,8 +12,8 @@ dest_files=["res://.godot/imported/forest_phase_3.ogg-55f42a1f5a8a4849a773f18490 [params] -loop=false -loop_offset=0 -bpm=0 +loop=true +loop_offset=0.0 +bpm=0.0 beat_count=0 bar_beats=4 diff --git a/gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd b/gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd new file mode 100644 index 0000000..217ed8c --- /dev/null +++ b/gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd @@ -0,0 +1,19 @@ +extends InGameIndicator +class_name InGameBaseIndicator + +@export var player : Player + +# Called when the node enters the scene tree for the first time. +func _ready(): + setup(tr("GARDEN")) + print(GameInfo.game_data.current_planet_data.garden_size/2) + follow_game_position(GameInfo.game_data.current_planet_data.garden_size/2) + +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.y < 0 + or player.global_position.y > GameInfo.game_data.current_planet_data.garden_size.y + ) + update() diff --git a/gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd.uid b/gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd.uid new file mode 100644 index 0000000..b96184b --- /dev/null +++ b/gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd.uid @@ -0,0 +1 @@ +uid://ds7ej47i3wsym diff --git a/gui/game/tutorial/in_game_indicator/scripts/in_game_indicator.gd b/gui/game/tutorial/in_game_indicator/scripts/in_game_indicator.gd index 0d073d0..97aedbe 100644 --- a/gui/game/tutorial/in_game_indicator/scripts/in_game_indicator.gd +++ b/gui/game/tutorial/in_game_indicator/scripts/in_game_indicator.gd @@ -33,7 +33,9 @@ func follow_entity(entity : Node2D): func _process(_d): show() + update() +func update(): var camera = get_viewport().get_camera_2d() var screen_size = get_viewport().get_visible_rect().size diff --git a/gui/game/tutorial/scripts/tutorial.gd b/gui/game/tutorial/scripts/tutorial.gd index 0d809bd..1c610ff 100644 --- a/gui/game/tutorial/scripts/tutorial.gd +++ b/gui/game/tutorial/scripts/tutorial.gd @@ -13,8 +13,8 @@ var indicators : Array[InGameIndicator] TakeSeedStep.new(), PlantSeedStep.new(), RechargeStep.new(), - WaitMaturePlant.new(), - HarvestMaturePlant.new(), + # WaitMaturePlant.new(), + # HarvestMaturePlant.new(), ] var actual_step : Step = null : set = pass_to_step diff --git a/stages/planet_run/planet_run.tscn b/stages/planet_run/planet_run.tscn index f1a18eb..693a206 100644 --- a/stages/planet_run/planet_run.tscn +++ b/stages/planet_run/planet_run.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=10 format=3 uid="uid://d28cp7a21kwou"] +[gd_scene load_steps=12 format=3 uid="uid://d28cp7a21kwou"] [ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="1_yy1uy"] [ext_resource type="PackedScene" uid="uid://v41hfc7haaye" path="res://gui/game/win/win.tscn" id="3_6guxm"] [ext_resource type="PackedScene" uid="uid://doxm7uab8i3tq" path="res://gui/game/quota_reward/quota_reward.tscn" id="4_fbkgs"] [ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="4_g33f4"] +[ext_resource type="PackedScene" uid="uid://fh3dsuvn5h78" path="res://gui/game/tutorial/in_game_indicator/in_game_indicator.tscn" id="5_gisiu"] [ext_resource type="PackedScene" uid="uid://dt6mptqg80dew" path="res://gui/game/tutorial/tutorial.tscn" id="5_orelw"] +[ext_resource type="Script" uid="uid://ds7ej47i3wsym" path="res://gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd" id="6_cnjsq"] [ext_resource type="PackedScene" uid="uid://tsi5j1uxppa4" path="res://stages/terrain/planet/planet.tscn" id="8_t31p7"] [ext_resource type="PackedScene" uid="uid://cg1visg52i21a" path="res://entities/interactables/truck/ladder/truck_ladder.tscn" id="9_gisiu"] [ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="10_cnjsq"] @@ -15,12 +17,12 @@ [node name="Reward" parent="." instance=ExtResource("4_fbkgs")] layer = 2 -[node name="CanvasLayer" type="CanvasLayer" parent="."] - -[node name="RootGui" parent="CanvasLayer" node_paths=PackedStringArray("quota_reward") instance=ExtResource("1_yy1uy")] -quota_reward = NodePath("../../Reward") +[node name="RootGui" parent="." node_paths=PackedStringArray("quota_reward") instance=ExtResource("1_yy1uy")] +quota_reward = NodePath("../Reward") metadata/_edit_use_anchors_ = true +[node name="CanvasLayer" type="CanvasLayer" parent="."] + [node name="Win" parent="CanvasLayer" instance=ExtResource("3_6guxm")] visible = false @@ -28,6 +30,14 @@ visible = false player = NodePath("../../Entities/Player") planet = NodePath("../../Planet") +[node name="BaseIndicator" parent="CanvasLayer" node_paths=PackedStringArray("player") instance=ExtResource("5_gisiu")] +visible = false +offset_bottom = 91.0 +size_flags_horizontal = 4 +size_flags_vertical = 4 +script = ExtResource("6_cnjsq") +player = NodePath("../../Entities/Player") + [node name="Entities" type="Node2D" parent="."] y_sort_enabled = true @@ -50,5 +60,5 @@ position = Vector2(2.22, 0) following = NodePath("../Entities/Player") [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="pass_day_ended" from="Planet" to="RootGui" method="_on_planet_pass_day_ended"] +[connection signal="pass_day_started" from="Planet" to="RootGui" method="_on_planet_pass_day_started"] diff --git a/stages/terrain/planet/scripts/garden.gd b/stages/terrain/planet/scripts/garden.gd index 72e3f44..81b5e56 100644 --- a/stages/terrain/planet/scripts/garden.gd +++ b/stages/terrain/planet/scripts/garden.gd @@ -66,6 +66,7 @@ func plant( ) plants.append(new_plant) + planet_data.score_by_plant.append(0) new_plant.harvested.connect(_on_plant_harvested) new_plant.state_changed.connect(_on_plant_state_changed) return new_plant @@ -80,6 +81,7 @@ func remove_plant(p: Plant): var id = plants.find(p) if id >= 0: plants.remove_at(id) + planet_data.score_by_plant.remove_at(id) update_garden_score()