Compare commits

...

2 Commits

Author SHA1 Message Date
c895dfe9a0 made a dedicated scene for simple on-screen tutorials
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 6m11s
2025-11-08 10:56:35 +01:00
1ea3945cf6 final tutorial setup and UI fix
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Export (push) Successful in 6m9s
2025-11-06 09:29:05 +01:00
8 changed files with 285 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=37 format=3 uid="uid://dmkw8cmalm5k"]
[gd_scene load_steps=44 format=3 uid="uid://dmkw8cmalm5k"]
[ext_resource type="PackedScene" uid="uid://bei4nhkf8lwdo" path="res://player_controller/PlayerController.tscn" id="1_2vsi6"]
[ext_resource type="Texture2D" uid="uid://ca4kkq3w8cd4n" path="res://assets/sky/sky_15_2k.png" id="2_ruo5i"]
@@ -18,11 +18,13 @@
[ext_resource type="Texture2D" uid="uid://dl73t0kxkaxp0" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_a_outline.svg" id="16_2k3fr"]
[ext_resource type="Texture2D" uid="uid://blfc13splpcld" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_stick_l.svg" id="16_crf87"]
[ext_resource type="Script" uid="uid://dvieq1o7ci70y" path="res://systems/ui/tutorial_controller.gd" id="16_efsse"]
[ext_resource type="PackedScene" uid="uid://b8aet6m4m2i83" path="res://scenes/tuto_trigger/TutoTrigger.tscn" id="16_qwuk2"]
[ext_resource type="Texture2D" uid="uid://com0lpfuol6vk" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_stick_r.svg" id="17_rmfv1"]
[ext_resource type="PackedScene" uid="uid://kktuyhbd5xgc" path="res://menus/scenes/overlaid_menus/tuto_got_sword.tscn" id="17_t0d86"]
[ext_resource type="Texture2D" uid="uid://cjh5cnvdbq5ku" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_button_b_outline.svg" id="19_efsse"]
[ext_resource type="Texture2D" uid="uid://nrhxjdpuje3f" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_lt_outline.svg" id="20_crf87"]
[ext_resource type="Texture2D" uid="uid://bfkj4neu0m0rm" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_rt_outline.svg" id="21_rmfv1"]
[ext_resource type="Texture2D" uid="uid://dyjvbsvbriii4" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_rb_outline.svg" id="23_p287n"]
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_feb1n"]
panorama = ExtResource("2_ruo5i")
@@ -70,12 +72,27 @@ size = Vector3(12, 11.5, 5)
[sub_resource type="BoxShape3D" id="BoxShape3D_nrosh"]
size = Vector3(8, 16.5, 25.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_lnjrw"]
size = Vector3(14, 15.5, 13.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_lgco8"]
size = Vector3(12, 14.5, 11)
[sub_resource type="BoxShape3D" id="BoxShape3D_51ivn"]
size = Vector3(12, 14.5, 11)
[sub_resource type="BoxShape3D" id="BoxShape3D_3w3wd"]
size = Vector3(13, 16.5, 11.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_lu3yt"]
size = Vector3(11.5, 9, 4.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_pxspk"]
size = Vector3(11.5, 9, 4.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_5hbxb"]
size = Vector3(9.5, 2, 5.5)
[sub_resource type="LabelSettings" id="LabelSettings_2k3fr"]
font_size = 30
@@ -206,6 +223,42 @@ collision_mask = 16
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 1.0587616, 7.5, 5.1117268)
shape = SubResource("BoxShape3D_nrosh")
[node name="TriggerTutoWeaponThrow" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, 4.428787, 58, 19.770819)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoWeaponThrow"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 4.4208603, 7, -4.632329)
shape = SubResource("BoxShape3D_lnjrw")
[node name="TriggerTutoEmpoweredDash" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, -25.417572, 58, 16.138357)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoEmpoweredDash"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 3.4464645, 6.5, -4.9685373)
shape = SubResource("BoxShape3D_lgco8")
[node name="TriggerTutoEmpoweredJump" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, -59.648212, 58, 10.263556)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoEmpoweredJump"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 3.4464645, 6.5, -4.9685373)
shape = SubResource("BoxShape3D_51ivn")
[node name="TriggerTutoEnjoy" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.9961947, 0, -0.087155744, 0, 1, 0, 0.087155744, 0, 0.9961947, -120.81145, 214.5, 2.417603)
collision_layer = 0
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TriggerTutoEnjoy"]
transform = Transform3D(0.9961947, 0, -0.08715595, 0, 1, 0, 0.08715595, 0, 0.9961947, 3.9663503, 5.5, -5.174009)
shape = SubResource("BoxShape3D_3w3wd")
[node name="TutorialDoneArea" type="Area3D" parent="TutoTriggers"]
transform = Transform3D(0.14133324, 0, 0.98996216, 0, 1, 0, -0.98996216, 0, 0.14133324, 7.9436035, 53.74933, 16.672102)
collision_layer = 0
@@ -224,6 +277,16 @@ collision_mask = 16
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7500105, 4, 0.7499695)
shape = SubResource("BoxShape3D_pxspk")
[node name="TutoTrigger" parent="TutoTriggers" instance=ExtResource("16_qwuk2")]
transform = Transform3D(0.054514553, 0, 0.99851304, 0, 1, 0, -0.99851304, 0, 0.054514553, -9.365448, -0.7506714, -14.818321)
first_input_texture = ExtResource("16_2k3fr")
complex_input_text = "while on wall"
tuto_text = "Jump"
[node name="CollisionShape3D" type="CollisionShape3D" parent="TutoTriggers/TutoTrigger"]
transform = Transform3D(0.9848077, 0, -0.17364818, 0, 1, 0, 0.17364818, 0, 0.9848077, 1.8592949, 0.5, 2.2158203)
shape = SubResource("BoxShape3D_5hbxb")
[node name="TutorialController" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
@@ -402,6 +465,30 @@ layout_mode = 2
text = "Dash towards sword"
label_settings = SubResource("LabelSettings_2k3fr")
[node name="TutoWeaponThrow" type="HBoxContainer" parent="TutorialController/PanelContainer/MarginContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
theme_override_constants/separation = 20
[node name="HBoxContainer" type="HBoxContainer" parent="TutorialController/PanelContainer/MarginContainer/TutoWeaponThrow"]
layout_mode = 2
theme_override_constants/separation = 0
[node name="TextureRect" type="TextureRect" parent="TutorialController/PanelContainer/MarginContainer/TutoWeaponThrow/HBoxContainer"]
layout_mode = 2
texture = ExtResource("23_p287n")
[node name="Label2" type="Label" parent="TutorialController/PanelContainer/MarginContainer/TutoWeaponThrow/HBoxContainer"]
layout_mode = 2
text = "while aiming"
label_settings = SubResource("LabelSettings_2k3fr")
[node name="Label3" type="Label" parent="TutorialController/PanelContainer/MarginContainer/TutoWeaponThrow"]
layout_mode = 2
text = "Throw weapon"
label_settings = SubResource("LabelSettings_2k3fr")
[node name="TutoEmpoweredDash" type="HBoxContainer" parent="TutorialController/PanelContainer/MarginContainer"]
unique_name_in_owner = true
visible = false
@@ -458,6 +545,17 @@ layout_mode = 2
text = "Empowered jump"
label_settings = SubResource("LabelSettings_2k3fr")
[node name="TutoEnjoy" type="HBoxContainer" parent="TutorialController/PanelContainer/MarginContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
theme_override_constants/separation = 15
[node name="label" type="Label" parent="TutorialController/PanelContainer/MarginContainer/TutoEnjoy"]
layout_mode = 2
text = "Enjoy this little playground!"
label_settings = SubResource("LabelSettings_2k3fr")
[connection signal="body_exited" from="TutoTriggers/TriggerTutoMove" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoMantle" to="TutorialController" method="_on_tuto_mantle_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoMantle" to="TutorialController" method="hide_tutorials"]
@@ -471,6 +569,14 @@ label_settings = SubResource("LabelSettings_2k3fr")
[connection signal="body_exited" from="TutoTriggers/TriggerTutoWallJump2" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoDash" to="TutorialController" method="_on_tuto_dash_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoDash" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoWeaponThrow" to="TutorialController" method="_on_tuto_weapon_throw_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoWeaponThrow" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoEmpoweredDash" to="TutorialController" method="_on_tuto_empowered_dash_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoEmpoweredDash" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoEmpoweredJump" to="TutorialController" method="_on_tuto_empowered_jump_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoEmpoweredJump" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TriggerTutoEnjoy" to="TutorialController" method="_on_tuto_enjoy_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TriggerTutoEnjoy" to="TutorialController" method="hide_tutorials"]
[connection signal="body_entered" from="TutoTriggers/TutorialDoneArea" to="Player" method="OnTutorialDone"]
[connection signal="body_entered" from="TutoTriggers/TutorialDoneArea" to="TutorialController" method="_on_tuto_done_area_body_entered"]
[connection signal="body_exited" from="TutoTriggers/TutorialDoneArea" to="TutorialController" method="hide_tutorials"]

View File

@@ -223,44 +223,47 @@ initial_node_to_watch = NodePath("../StateChart")
[node name="UI" type="CanvasLayer" parent="."]
script = ExtResource("30_2ghaa")
[node name="VBoxContainer" type="VBoxContainer" parent="UI"]
offset_right = 128.0
offset_bottom = 81.0
[node name="DashesLabel" type="Label" parent="UI/VBoxContainer"]
layout_mode = 2
text = "Dashes"
[node name="HBoxContainer" type="HBoxContainer" parent="UI/VBoxContainer"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
[node name="Dash1" type="TextureRect" parent="UI/VBoxContainer/HBoxContainer"]
layout_mode = 2
texture = ExtResource("30_h23go")
expand_mode = 2
[node name="Dash2" type="TextureRect" parent="UI/VBoxContainer/HBoxContainer"]
layout_mode = 2
texture = ExtResource("30_h23go")
expand_mode = 2
[node name="Dash3" type="TextureRect" parent="UI/VBoxContainer/HBoxContainer"]
layout_mode = 2
texture = ExtResource("30_h23go")
expand_mode = 2
[node name="DashCooldownIndicator" type="ColorRect" parent="UI"]
unique_name_in_owner = true
[node name="MarginContainer" type="MarginContainer" parent="UI"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 910.0
offset_top = 549.0
offset_right = -910.0
offset_bottom = -521.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 50
theme_override_constants/margin_right = 50
theme_override_constants/margin_bottom = 50
[node name="VBoxContainer" type="VBoxContainer" parent="UI/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
[node name="DashesLabel" type="Label" parent="UI/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Dashes"
[node name="HBoxContainer" type="HBoxContainer" parent="UI/MarginContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
[node name="Dash1" type="TextureRect" parent="UI/MarginContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
texture = ExtResource("30_h23go")
expand_mode = 2
[node name="Dash2" type="TextureRect" parent="UI/MarginContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
texture = ExtResource("30_h23go")
expand_mode = 2
[node name="Dash3" type="TextureRect" parent="UI/MarginContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
texture = ExtResource("30_h23go")
expand_mode = 2
[node name="CenterContainer" type="CenterContainer" parent="UI"]
custom_minimum_size = Vector2(1920, 1080)
@@ -278,6 +281,22 @@ layout_mode = 2
texture = ExtResource("32_lgpc8")
expand_mode = 1
[node name="CenterContainer2" type="CenterContainer" parent="UI"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="UI/CenterContainer2"]
layout_mode = 2
theme_override_constants/margin_top = 50
[node name="DashCooldownIndicator" type="ColorRect" parent="UI/CenterContainer2/MarginContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 10)
layout_mode = 2
[node name="StateChart" type="Node" parent="."]
script = ExtResource("25_wv70j")
metadata/_custom_type_script = "uid://couw105c3bde4"

View File

@@ -9,9 +9,9 @@ public partial class PlayerUi : CanvasLayer
{
base._Ready();
_dashIcons[0] = GetNode<TextureRect>("VBoxContainer/HBoxContainer/Dash1");
_dashIcons[1] = GetNode<TextureRect>("VBoxContainer/HBoxContainer/Dash2");
_dashIcons[2] = GetNode<TextureRect>("VBoxContainer/HBoxContainer/Dash3");
_dashIcons[0] = GetNode<TextureRect>("%Dash1");
_dashIcons[1] = GetNode<TextureRect>("%Dash2");
_dashIcons[2] = GetNode<TextureRect>("%Dash3");
}
public void SetNumberOfDashesLeft(int numberOfDashes)

View File

@@ -601,7 +601,7 @@ public partial class PlayerController : CharacterBody3D
public void PowerRecharging(float delta)
{
var progress = (float) (_powerCooldownTimer.TimeLeft / _powerCooldownTimer.WaitTime);
PowerCooldownIndicator.SetSize(new Vector2(100 * progress, 10));
PowerCooldownIndicator.SetCustomMinimumSize(new Vector2(100 * progress, 10));
}
public void StartPowerCooldown()
{

View File

@@ -0,0 +1,70 @@
[gd_scene load_steps=4 format=3 uid="uid://b8aet6m4m2i83"]
[ext_resource type="Script" uid="uid://bnqhh6b5iusam" path="res://scenes/tuto_trigger/tuto_trigger.gd" id="1_w8mpv"]
[sub_resource type="LabelSettings" id="LabelSettings_4vbx1"]
font_size = 30
[sub_resource type="LabelSettings" id="LabelSettings_g04tr"]
font_size = 30
[node name="TutoTrigger" type="Area3D"]
collision_layer = 0
collision_mask = 16
script = ExtResource("1_w8mpv")
[node name="Control" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="PanelContainer" type="PanelContainer" parent="Control"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.5
anchor_top = 0.7
anchor_right = 0.5
anchor_bottom = 0.7
grow_horizontal = 2
grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="Control/PanelContainer"]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="HBoxContainer" type="HBoxContainer" parent="Control/PanelContainer/MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 20
[node name="MultipleInputsContainer" type="HBoxContainer" parent="Control/PanelContainer/MarginContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 0
[node name="FirstInput" type="TextureRect" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="ComplexInputLabel" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer"]
unique_name_in_owner = true
layout_mode = 2
label_settings = SubResource("LabelSettings_4vbx1")
[node name="SecondInput" type="TextureRect" parent="Control/PanelContainer/MarginContainer/HBoxContainer/MultipleInputsContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="TutoText" type="Label" parent="Control/PanelContainer/MarginContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
label_settings = SubResource("LabelSettings_g04tr")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_exited" from="." to="." method="_on_body_exited"]

View File

@@ -0,0 +1,37 @@
extends Area3D
@onready var control: Control = $Control
@onready var multiple_inputs_container: HBoxContainer = %MultipleInputsContainer
@onready var first_input: TextureRect = %FirstInput
@onready var complex_input_label: Label = %ComplexInputLabel
@onready var second_input: TextureRect = %SecondInput
@onready var tuto_label: Label = %TutoText
@export var first_input_texture: CompressedTexture2D
@export var second_input_texture: CompressedTexture2D
@export var complex_input_text: String
@export var tuto_text: String
func _ready() -> void:
tuto_label.text = tuto_text
first_input.texture = first_input_texture
second_input.texture = second_input_texture
complex_input_label.text = complex_input_text
if second_input_texture != null:
complex_input_label.text = "+"
if second_input_texture == null and complex_input_text.is_empty():
complex_input_label.visible = false
second_input.visible = false
func _on_body_entered(body: Node3D) -> void:
control.visible = true
func _on_body_exited(body: Node3D) -> void:
control.visible = false

View File

@@ -0,0 +1 @@
uid://bnqhh6b5iusam

View File

@@ -15,8 +15,10 @@ var active_tutorial: Control
@onready var tuto_wall_jump: HBoxContainer = %TutoWallJump
@onready var tuto_dash: HBoxContainer = %TutoDash
@onready var tuto_dash_weapon: HBoxContainer = %TutoDashWeapon
@onready var tuto_weapon_throw: HBoxContainer = %TutoWeaponThrow
@onready var tuto_empowered_dash: HBoxContainer = %TutoEmpoweredDash
@onready var tuto_empowered_jump: HBoxContainer = %TutoEmpoweredJump
@onready var tuto_enjoy: HBoxContainer = %TutoEnjoy
func _ready() -> void:
@@ -55,6 +57,18 @@ func _on_tuto_done_area_body_entered(body: Node3D) -> void:
func _on_weapon_retrieved_body_entered(body: Node3D) -> void:
wait_to_show_blocking_tuto.start()
func _on_tuto_weapon_throw_body_entered(body: Node3D) -> void:
handle_new_tutorial(tuto_weapon_throw)
func _on_tuto_empowered_dash_body_entered(body: Node3D) -> void:
handle_new_tutorial(tuto_empowered_dash)
func _on_tuto_empowered_jump_body_entered(body: Node3D) -> void:
handle_new_tutorial(tuto_empowered_jump)
func _on_tuto_enjoy_body_entered(body: Node3D) -> void:
handle_new_tutorial(tuto_enjoy)
func _show_weapon_tutorial() -> void:
if already_shown_weapon_tuto:
return