From aa6a5ca9644d4f11c775726ab59b1b4b3e05b455 Mon Sep 17 00:00:00 2001 From: minimata Date: Sat, 28 Jun 2025 14:33:47 +0200 Subject: [PATCH] feat: wrong building scene --- scenes/main.gd | 9 +- scenes/main.tscn | 2 + scenes/text_wrappers/intro.tscn | 4 +- .../{intro.gd => text_wrapper.gd} | 0 .../{intro.gd.uid => text_wrapper.gd.uid} | 0 scenes/text_wrappers/wrong_building.tscn | 124 ++++++++++++++++++ 6 files changed, 136 insertions(+), 3 deletions(-) rename scenes/text_wrappers/{intro.gd => text_wrapper.gd} (100%) rename scenes/text_wrappers/{intro.gd.uid => text_wrapper.gd.uid} (100%) create mode 100644 scenes/text_wrappers/wrong_building.tscn diff --git a/scenes/main.gd b/scenes/main.gd index 56d555b..6b3deef 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -1,5 +1,8 @@ extends Node2D +@export_file("*.tscn") var wrong_building: String +@export_file("*.tscn") var next_level: String + @export var base_mode: GUIDEMappingContext @@ -14,4 +17,8 @@ func _process(delta: float) -> void: func _on_door_event_triggered(event_id: String) -> void: - print(event_id) + if event_id == "right": + SceneLoader.load_scene(next_level) + return + + SceneLoader.load_scene(wrong_building) diff --git a/scenes/main.tscn b/scenes/main.tscn index d2cc3a0..9b99cfb 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -722,6 +722,7 @@ sources/0 = SubResource("TileSetAtlasSource_tbgi4") [node name="Main" type="Node2D"] script = ExtResource("1_0wfyh") +wrong_building = "uid://eh3y4s4qad8m" base_mode = ExtResource("2_sugp2") [node name="Background" type="TileMapLayer" parent="."] @@ -750,6 +751,7 @@ region_rect = Rect2(238, 170, 16, 16) [node name="RightDoor" parent="." instance=ExtResource("5_tefeu")] position = Vector2(424, 8) message = "Entrer dans l'hotel ?" +interact_text = "porte" event = "right" [node name="Sprite2D" type="Sprite2D" parent="RightDoor"] diff --git a/scenes/text_wrappers/intro.tscn b/scenes/text_wrappers/intro.tscn index 4fec3d8..6ed34fc 100644 --- a/scenes/text_wrappers/intro.tscn +++ b/scenes/text_wrappers/intro.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=3 uid="uid://djmvj0uqw26dg"] [ext_resource type="PackedScene" uid="uid://bhhphcagggc1" path="res://template/scenes/credits/scrolling_credits.tscn" id="1_ftj6e"] -[ext_resource type="Script" uid="uid://bwr3tliac4mo2" path="res://scenes/text_wrappers/intro.gd" id="2_sbctf"] +[ext_resource type="Script" uid="uid://bwr3tliac4mo2" path="res://scenes/text_wrappers/text_wrapper.gd" id="2_sbctf"] [ext_resource type="PackedScene" uid="uid://bkcsjsk2ciff" path="res://addons/maaacks_menus_template/base/scenes/music_players/background_music_player.tscn" id="3_pbsew"] [ext_resource type="Script" uid="uid://1nf36h0gms3q" path="res://addons/maaacks_menus_template/base/scripts/capture_focus.gd" id="4_23spi"] [ext_resource type="AudioStream" uid="uid://dcylcol0nj0pv" path="res://assets/Audio/CIN_INTRO_Pitch mission.ogg" id="4_mudqr"] @@ -62,7 +62,7 @@ __FINGERPRINT: NO-MECANIC__ /!\\ CONNEXION SECURE /!\\ --- VOTRE NOM DE CODE POUR CETTE MISSION: DINO SÉRIEUX. -VOTRE BUT: REJOINDRE L’AGENTE DINO LOGHORÉE QUI EST SOUS COUVERTURE DANS LA MÉGACORPORATION ONID. DEPUIS DES MOIS, ELLE CULTIVE UN RAPPORT AVEC LA CIBLE, LA CEO DE ONID, AFIN DE POUVOIR LA DISTRAIRE AUJOURD'HUI. +VOTRE BUT: REJOINDRE L AGENTE DINO LOGHORÉE QUI EST SOUS COUVERTURE DANS LA MÉGACORPORATION ONID. DEPUIS DES MOIS, ELLE CULTIVE UN RAPPORT AVEC LA CIBLE, LA CEO DE ONID, AFIN DE POUVOIR LA DISTRAIRE AUJOURD'HUI. SUIVEZ SES INSTRUCTIONS DANS L'OREILLETTE, ET VOLEZ LES DONNÉES SAUVEGARDÉES SUR LA CIBLE. AVEC CES DONNÉES, NOUS EXPOSERONS LES MALVERSATIONS DE LA MÉGACORPORATION ONID. diff --git a/scenes/text_wrappers/intro.gd b/scenes/text_wrappers/text_wrapper.gd similarity index 100% rename from scenes/text_wrappers/intro.gd rename to scenes/text_wrappers/text_wrapper.gd diff --git a/scenes/text_wrappers/intro.gd.uid b/scenes/text_wrappers/text_wrapper.gd.uid similarity index 100% rename from scenes/text_wrappers/intro.gd.uid rename to scenes/text_wrappers/text_wrapper.gd.uid diff --git a/scenes/text_wrappers/wrong_building.tscn b/scenes/text_wrappers/wrong_building.tscn new file mode 100644 index 0000000..dc7f8ea --- /dev/null +++ b/scenes/text_wrappers/wrong_building.tscn @@ -0,0 +1,124 @@ +[gd_scene load_steps=5 format=3 uid="uid://eh3y4s4qad8m"] + +[ext_resource type="PackedScene" uid="uid://bhhphcagggc1" path="res://template/scenes/credits/scrolling_credits.tscn" id="1_o8vp5"] +[ext_resource type="Script" uid="uid://bwr3tliac4mo2" path="res://scenes/text_wrappers/text_wrapper.gd" id="2_fg6t0"] +[ext_resource type="PackedScene" uid="uid://bkcsjsk2ciff" path="res://addons/maaacks_menus_template/base/scenes/music_players/background_music_player.tscn" id="3_fs5lg"] +[ext_resource type="Script" uid="uid://1nf36h0gms3q" path="res://addons/maaacks_menus_template/base/scripts/capture_focus.gd" id="5_0ltfy"] + +[node name="WrongBuilding" instance=ExtResource("1_o8vp5")] +script = ExtResource("2_fg6t0") +scene_to_trigger = "uid://ck5glr84c7e25" + +[node name="BackgroundMusicPlayer" parent="." index="0" instance=ExtResource("3_fs5lg")] +bus = &"Cinematique" + +[node name="BackgroundColor" type="ColorRect" parent="." index="1"] +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, 1) + +[node name="BackgroundTextureRect" type="TextureRect" parent="." index="2"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +expand_mode = 1 +stretch_mode = 5 + +[node name="ScrollContainer" parent="." index="3"] +visible = false +scroll_vertical = 0 + +[node name="CenterContainer" type="CenterContainer" parent="." index="4"] +layout_mode = 0 +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +mouse_filter = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer" index="0"] +custom_minimum_size = Vector2(600, 0) +layout_mode = 2 + +[node name="Message" type="Label" parent="CenterContainer/VBoxContainer" index="0"] +unique_name_in_owner = true +custom_minimum_size = Vector2(360, 0) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "__CALL IN PROGRESS__ +--- +__HANDSHAKE OVER__ +__FINGERPRINT: NO-MECANIC__ +/!\\ CONNEXION SECURE /!\\ +--- +DINO SÉRIEUX TU AS TROP FAIT LE RIGOLO, TU T'ES TROMPÉ DE BATIMENT! +" +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="CenterContainer" type="CenterContainer" parent="CenterContainer/VBoxContainer" index="1"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/CenterContainer" index="0"] +custom_minimum_size = Vector2(256, 0) +layout_mode = 2 +size_flags_vertical = 3 +theme_override_constants/separation = 16 +script = ExtResource("5_0ltfy") + +[node name="AcceptButton1" type="Button" parent="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer" index="0"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "GAME OVER" + +[node name="AcceptButton2" type="Button" parent="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer" index="1"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "TRY AGAIN" + +[node name="EndMessagePanel" type="Panel" parent="CenterContainer" index="1"] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(360, 120) +layout_mode = 2 + +[node name="StartConnexion" type="Timer" parent="." index="5"] +wait_time = 0.5 +one_shot = true +autostart = true + +[node name="FurtherConnexion" type="Timer" parent="." index="6"] +wait_time = 0.5 +one_shot = true + +[node name="TextStart" type="Timer" parent="." index="7"] +one_shot = true + +[node name="TimeBetweenWords" type="Timer" parent="." index="8"] +wait_time = 0.15 + +[node name="TimeBeforeShowButtons" type="Timer" parent="." index="9"] +wait_time = 2.0 +one_shot = true + +[connection signal="pressed" from="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer/AcceptButton1" to="." method="start_mission"] +[connection signal="pressed" from="CenterContainer/VBoxContainer/CenterContainer/HBoxContainer/AcceptButton2" to="." method="start_mission"] +[connection signal="timeout" from="StartConnexion" to="." method="_on_start_connexion_timeout"] +[connection signal="timeout" from="FurtherConnexion" to="." method="_on_further_connexion_timeout"] +[connection signal="timeout" from="TextStart" to="." method="_on_text_start_timeout"] +[connection signal="timeout" from="TimeBetweenWords" to="." method="_on_time_between_words_timeout"] +[connection signal="timeout" from="TimeBeforeShowButtons" to="." method="_on_time_before_show_buttons_timeout"]