From 05227c75fd71e3adfe4d5d5936bce0ab097d4c63 Mon Sep 17 00:00:00 2001 From: Waldemar Tomme Date: Sun, 28 Jan 2024 07:28:55 +0100 Subject: [PATCH] Add tutorial scene --- godot/scenes/main_menu_scene.tscn | 4 ++-- godot/scenes/tutorial.gd | 14 +++++++++++++ godot/scenes/tutorial.tscn | 34 +++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 godot/scenes/tutorial.gd create mode 100644 godot/scenes/tutorial.tscn diff --git a/godot/scenes/main_menu_scene.tscn b/godot/scenes/main_menu_scene.tscn index 304ddd0..0308347 100644 --- a/godot/scenes/main_menu_scene.tscn +++ b/godot/scenes/main_menu_scene.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=8 format=3 uid="uid://dv2y18ye8j7o0"] [ext_resource type="Script" path="res://scenes/main_menu_scene.gd" id="1_1foie"] -[ext_resource type="PackedScene" uid="uid://cik30de5gaaah" path="res://scenes/ingame_scene.tscn" id="2_nl5i6"] +[ext_resource type="PackedScene" uid="uid://dsbpdd7xdslx0" path="res://scenes/tutorial.tscn" id="2_o0xek"] [ext_resource type="PackedScene" uid="uid://g4qhvbvdm62w" path="res://scenes/game_settings_scene.tscn" id="3_dgs4d"] [ext_resource type="PackedScene" uid="uid://bkk87o2ooo6at" path="res://ui/overlays/fade_overlay.tscn" id="3_kf1us"] [ext_resource type="PackedScene" uid="uid://b4blrdjthcxnn" path="res://ui/components/game_logo.tscn" id="4_fnufg"] @@ -13,7 +13,7 @@ font_color = Color(1, 1, 1, 0.486275) [node name="MainMenuScene" type="Node2D"] script = ExtResource("1_1foie") -game_scene = ExtResource("2_nl5i6") +game_scene = ExtResource("2_o0xek") settings_scene = ExtResource("3_dgs4d") [node name="UI" type="CanvasLayer" parent="."] diff --git a/godot/scenes/tutorial.gd b/godot/scenes/tutorial.gd new file mode 100644 index 0000000..ad0ad55 --- /dev/null +++ b/godot/scenes/tutorial.gd @@ -0,0 +1,14 @@ +extends Node2D + +@export var next_scene: PackedScene + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _on_button_pressed(): + get_tree().change_scene_to_packed(next_scene) diff --git a/godot/scenes/tutorial.tscn b/godot/scenes/tutorial.tscn new file mode 100644 index 0000000..18acb54 --- /dev/null +++ b/godot/scenes/tutorial.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=3 format=3 uid="uid://dsbpdd7xdslx0"] + +[ext_resource type="Script" path="res://scenes/tutorial.gd" id="1_i8rpu"] +[ext_resource type="PackedScene" uid="uid://cik30de5gaaah" path="res://scenes/ingame_scene.tscn" id="2_lch8g"] + +[node name="Tutorial" type="Node2D"] +script = ExtResource("1_i8rpu") +next_scene = ExtResource("2_lch8g") + +[node name="AspectRatioContainer" type="AspectRatioContainer" parent="."] +offset_right = 576.0 +offset_bottom = 325.0 +ratio = 1.6306 + +[node name="VSplitContainer" type="VSplitContainer" parent="AspectRatioContainer"] +layout_mode = 2 +split_offset = 270 +dragger_visibility = 2 + +[node name="RichTextLabel" type="RichTextLabel" parent="AspectRatioContainer/VSplitContainer"] +layout_mode = 2 +text = "Can YOU please the crowd? + +Throw out jokes but be aware that not every joke is for everyone. +Can you please everyone before you run out of breath?" + +[node name="CenterContainer" type="CenterContainer" parent="AspectRatioContainer/VSplitContainer"] +layout_mode = 2 + +[node name="Button" type="Button" parent="AspectRatioContainer/VSplitContainer/CenterContainer"] +layout_mode = 2 +text = "I'm ready for the show!" + +[connection signal="pressed" from="AspectRatioContainer/VSplitContainer/CenterContainer/Button" to="." method="_on_button_pressed"]