From cd43b3361d7e4b53ca92cf330bb8379ccf1f6a8c Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 25 Feb 2025 14:06:41 +0100 Subject: [PATCH] Intro with new animator --- Music/Intro.mp3 | 3 + Music/Intro.mp3.import | 19 + Resources/Debug/DebugLevels.tres | 8 +- Scenes/Cutscenes/Intro.tscn | 530 +++++++++++++++++++++++- Scenes/MainMenu.tscn | 7 +- Scenes/Utils/StreamPlayerWithName.tscn | 10 + Scripts/Actors/Boss.cs | 1 + Scripts/UI/AudioNameVisualizer.cs | 60 +++ Scripts/UI/AudioNameVisualizer.cs.uid | 1 + Scripts/UI/IntroScenePlayer.cs | 54 ++- Scripts/UI/MusicVisualizerCanvas.cs | 49 +++ Scripts/UI/MusicVisualizerCanvas.cs.uid | 1 + Scripts/UI/MusicVisualizerCanvas.tscn | 30 ++ Sprites/UI/Note.aseprite | 3 + Sprites/UI/Note.png | 3 + Sprites/UI/Note.png.import | 34 ++ 16 files changed, 791 insertions(+), 22 deletions(-) create mode 100644 Music/Intro.mp3 create mode 100644 Music/Intro.mp3.import create mode 100644 Scenes/Utils/StreamPlayerWithName.tscn create mode 100644 Scripts/UI/AudioNameVisualizer.cs create mode 100644 Scripts/UI/AudioNameVisualizer.cs.uid create mode 100644 Scripts/UI/MusicVisualizerCanvas.cs create mode 100644 Scripts/UI/MusicVisualizerCanvas.cs.uid create mode 100644 Scripts/UI/MusicVisualizerCanvas.tscn create mode 100644 Sprites/UI/Note.aseprite create mode 100644 Sprites/UI/Note.png create mode 100644 Sprites/UI/Note.png.import diff --git a/Music/Intro.mp3 b/Music/Intro.mp3 new file mode 100644 index 00000000..190d3178 --- /dev/null +++ b/Music/Intro.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e1cfd5969017b9624e84534a16fb255829e39833649e8013177e3bbd1421247 +size 885056 diff --git a/Music/Intro.mp3.import b/Music/Intro.mp3.import new file mode 100644 index 00000000..e28bfce5 --- /dev/null +++ b/Music/Intro.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://7fo2dxosnjk4" +path="res://.godot/imported/Intro.mp3-46d9de9368a5813e4465d01f254e8cf6.mp3str" + +[deps] + +source_file="res://Music/Intro.mp3" +dest_files=["res://.godot/imported/Intro.mp3-46d9de9368a5813e4465d01f254e8cf6.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Resources/Debug/DebugLevels.tres b/Resources/Debug/DebugLevels.tres index 4db74fc8..a5514603 100644 --- a/Resources/Debug/DebugLevels.tres +++ b/Resources/Debug/DebugLevels.tres @@ -19,7 +19,7 @@ _name = "Intro" [sub_resource type="Resource" id="Resource_cfhv5"] script = ExtResource("1_ov731") EggIndex = 0 -StartingEquipment = Array[ExtResource("2_bkci5")]([]) +StartingEquipment = [] [sub_resource type="Resource" id="Resource_0k62o"] script = ExtResource("2_tnajf") @@ -31,7 +31,7 @@ StartData = SubResource("Resource_cfhv5") [sub_resource type="Resource" id="Resource_tpb7s"] script = ExtResource("1_ov731") EggIndex = 0 -StartingEquipment = Array[ExtResource("2_bkci5")]([]) +StartingEquipment = [] [sub_resource type="Resource" id="Resource_edoov"] script = ExtResource("2_tnajf") @@ -43,7 +43,7 @@ StartData = SubResource("Resource_tpb7s") [sub_resource type="Resource" id="Resource_1sw5g"] script = ExtResource("1_ov731") EggIndex = 255 -StartingEquipment = Array[ExtResource("2_bkci5")]([]) +StartingEquipment = [] [sub_resource type="Resource" id="Resource_47bot"] script = ExtResource("2_tnajf") @@ -73,7 +73,7 @@ _name = "Rebel Base" [sub_resource type="Resource" id="Resource_maxpt"] script = ExtResource("1_ov731") EggIndex = 0 -StartingEquipment = Array[ExtResource("2_bkci5")]([]) +StartingEquipment = [] [sub_resource type="Resource" id="Resource_pein5"] script = ExtResource("2_tnajf") diff --git a/Scenes/Cutscenes/Intro.tscn b/Scenes/Cutscenes/Intro.tscn index c63fc51a..58a0eaa9 100644 --- a/Scenes/Cutscenes/Intro.tscn +++ b/Scenes/Cutscenes/Intro.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=25 format=3 uid="uid://oaxftu6lytvv"] +[gd_scene load_steps=31 format=3 uid="uid://oaxftu6lytvv"] [ext_resource type="Script" uid="uid://d1cxthcj2fc10" path="res://Scripts/UI/IntroScenePlayer.cs" id="1_jtu71"] [ext_resource type="Texture2D" uid="uid://4skj5ik6qpu4" path="res://Sprites/Briefing/Intro1small.png" id="2_6u3to"] @@ -19,6 +19,9 @@ [ext_resource type="Texture2D" uid="uid://bqob6es5r8w6m" path="res://Sprites/Briefing/Intro14.png" id="15_aiaxc"] [ext_resource type="Texture2D" uid="uid://bu1n0vbvv1u3d" path="res://Sprites/Briefing/Intro15.png" id="16_augg6"] [ext_resource type="Texture2D" uid="uid://dweqr0jvc3w5u" path="res://Sprites/Briefing/Intro16.png" id="17_5dxui"] +[ext_resource type="Texture2D" uid="uid://xvadkvwajs0t" path="res://Sprites/UI/Crystal.png" id="19_paaiq"] +[ext_resource type="PackedScene" uid="uid://b3tyacxxw88lx" path="res://Scenes/Utils/StreamPlayerWithName.tscn" id="20_8r24y"] +[ext_resource type="AudioStream" uid="uid://7fo2dxosnjk4" path="res://Music/Intro.mp3" id="21_p86nr"] [sub_resource type="Gradient" id="Gradient_k5r5b"] colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 1) @@ -45,12 +48,428 @@ colors = PackedColorArray(1, 0.984314, 1, 1, 1, 1, 1, 1) [sub_resource type="GradientTexture2D" id="GradientTexture2D_bnr5y"] gradient = SubResource("Gradient_mp1dh") -[node name="Intro" type="CanvasLayer" node_paths=PackedStringArray("PanelsHolder")] +[sub_resource type="Animation" id="Animation_8r24y"] +length = 40.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("MarginContainer/ImagesContainer/Intro1:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0.0333333), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("MarginContainer/ImagesContainer/Intro2:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("MarginContainer/ImagesContainer/Intro3:modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("MarginContainer/ImagesContainer/Intro4:modulate") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/4/type = "audio" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("AudioStreamPlayer2D2") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"clips": [], +"times": PackedFloat32Array() +} +tracks/4/use_blend = true +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("MarginContainer/ImagesContainer/Intro5:modulate") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/6/type = "value" +tracks/6/imported = false +tracks/6/enabled = true +tracks/6/path = NodePath("MarginContainer/ImagesContainer/Intro6:modulate") +tracks/6/interp = 1 +tracks/6/loop_wrap = true +tracks/6/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/7/type = "value" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath("MarginContainer/ImagesContainer/Intro11/Intro11-Crystal:position") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(41, 34)] +} +tracks/8/type = "value" +tracks/8/imported = false +tracks/8/enabled = true +tracks/8/path = NodePath("MarginContainer/ImagesContainer/Intro11/Intro11-Crystal:rotation") +tracks/8/interp = 1 +tracks/8/loop_wrap = true +tracks/8/keys = { +"times": PackedFloat32Array(0.0333333), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/9/type = "value" +tracks/9/imported = false +tracks/9/enabled = true +tracks/9/path = NodePath("MarginContainer/ImagesContainer/Intro15:modulate") +tracks/9/interp = 1 +tracks/9/loop_wrap = true +tracks/9/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} +tracks/10/type = "value" +tracks/10/imported = false +tracks/10/enabled = true +tracks/10/path = NodePath("MarginContainer/ImagesContainer/Intro14:modulate") +tracks/10/interp = 1 +tracks/10/loop_wrap = true +tracks/10/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} +tracks/11/type = "value" +tracks/11/imported = false +tracks/11/enabled = true +tracks/11/path = NodePath("MarginContainer/ImagesContainer/Intro11/Intro11-Crystal:modulate") +tracks/11/interp = 1 +tracks/11/loop_wrap = true +tracks/11/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} + +[sub_resource type="Animation" id="Animation_d4oe4"] +resource_name = "intro" +length = 39.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("MarginContainer/ImagesContainer/Intro1:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0.0666667, 0.866667, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("MarginContainer/ImagesContainer/Intro2:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(1.93333, 2.8, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("MarginContainer/ImagesContainer/Intro3:modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(3.8, 4.56667, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("MarginContainer/ImagesContainer/Intro4:modulate") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(5.3, 6, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("MarginContainer/ImagesContainer/Intro5:modulate") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(6.46667, 7.2, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("MarginContainer/ImagesContainer/Intro6:modulate") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(8.13333, 8.8, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/6/type = "value" +tracks/6/imported = false +tracks/6/enabled = true +tracks/6/path = NodePath("MarginContainer/ImagesContainer/Intro7:modulate") +tracks/6/interp = 1 +tracks/6/loop_wrap = true +tracks/6/keys = { +"times": PackedFloat32Array(9.63333, 10.4, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/7/type = "value" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath("MarginContainer/ImagesContainer/Intro8:modulate") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(11.6, 12.4667, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/8/type = "value" +tracks/8/imported = false +tracks/8/enabled = true +tracks/8/path = NodePath("MarginContainer/ImagesContainer/Intro9:modulate") +tracks/8/interp = 1 +tracks/8/loop_wrap = true +tracks/8/keys = { +"times": PackedFloat32Array(14.5, 15.3667, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/9/type = "value" +tracks/9/imported = false +tracks/9/enabled = true +tracks/9/path = NodePath("MarginContainer/ImagesContainer/Intro10:modulate") +tracks/9/interp = 1 +tracks/9/loop_wrap = true +tracks/9/keys = { +"times": PackedFloat32Array(17.7667, 18.3667, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/10/type = "value" +tracks/10/imported = false +tracks/10/enabled = true +tracks/10/path = NodePath("MarginContainer/ImagesContainer/Intro11:modulate") +tracks/10/interp = 1 +tracks/10/loop_wrap = true +tracks/10/keys = { +"times": PackedFloat32Array(19.9, 21.7, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/11/type = "value" +tracks/11/imported = false +tracks/11/enabled = true +tracks/11/path = NodePath("MarginContainer/ImagesContainer/Intro12:modulate") +tracks/11/interp = 1 +tracks/11/loop_wrap = true +tracks/11/keys = { +"times": PackedFloat32Array(24.4667, 25.3333, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/12/type = "value" +tracks/12/imported = false +tracks/12/enabled = true +tracks/12/path = NodePath("MarginContainer/ImagesContainer/Intro13:modulate") +tracks/12/interp = 1 +tracks/12/loop_wrap = true +tracks/12/keys = { +"times": PackedFloat32Array(27.6667, 28.4667, 35.7357, 35.9023), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/13/type = "value" +tracks/13/imported = false +tracks/13/enabled = true +tracks/13/path = NodePath("MarginContainer/ImagesContainer/Intro14:modulate") +tracks/13/interp = 1 +tracks/13/loop_wrap = true +tracks/13/keys = { +"times": PackedFloat32Array(32.7667, 33.5667, 37.3667, 37.5333), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/14/type = "value" +tracks/14/imported = false +tracks/14/enabled = true +tracks/14/path = NodePath("MarginContainer/ImagesContainer/Intro15:modulate") +tracks/14/interp = 1 +tracks/14/loop_wrap = true +tracks/14/keys = { +"times": PackedFloat32Array(36.5667, 36.6333, 37.9, 38), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/15/type = "audio" +tracks/15/imported = false +tracks/15/enabled = true +tracks/15/path = NodePath("AudioStreamPlayer2D2") +tracks/15/interp = 1 +tracks/15/loop_wrap = true +tracks/15/keys = { +"clips": [{ +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource("21_p86nr") +}], +"times": PackedFloat32Array(0) +} +tracks/15/use_blend = true +tracks/16/type = "value" +tracks/16/imported = false +tracks/16/enabled = true +tracks/16/path = NodePath("MarginContainer/ImagesContainer/Intro11/Intro11-Crystal:modulate") +tracks/16/interp = 1 +tracks/16/loop_wrap = true +tracks/16/keys = { +"times": PackedFloat32Array(), +"transitions": PackedFloat32Array(), +"update": 0, +"values": [] +} +tracks/17/type = "value" +tracks/17/imported = false +tracks/17/enabled = true +tracks/17/path = NodePath("MarginContainer/ImagesContainer/Intro11/Intro11-Crystal:position") +tracks/17/interp = 2 +tracks/17/loop_wrap = true +tracks/17/keys = { +"times": PackedFloat32Array(21.7333, 22.9), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(150, 0), Vector2(84.42, 24.035)] +} +tracks/18/type = "value" +tracks/18/imported = false +tracks/18/enabled = true +tracks/18/path = NodePath("MarginContainer/ImagesContainer/Intro11/Intro11-Crystal:rotation") +tracks/18/interp = 1 +tracks/18/loop_wrap = true +tracks/18/keys = { +"times": PackedFloat32Array(21.3054, 22.8), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0715585, 0.684169] +} +tracks/19/type = "method" +tracks/19/imported = false +tracks/19/enabled = true +tracks/19/path = NodePath("AudioStreamPlayer2D2") +tracks/19/interp = 1 +tracks/19/loop_wrap = true +tracks/19/keys = { +"times": PackedFloat32Array(0.233333), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"ShowName" +}] +} +tracks/20/type = "method" +tracks/20/imported = false +tracks/20/enabled = true +tracks/20/path = NodePath(".") +tracks/20/interp = 1 +tracks/20/loop_wrap = true +tracks/20/keys = { +"times": PackedFloat32Array(38.1667), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"Finished" +}] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_p86nr"] +_data = { +&"RESET": SubResource("Animation_8r24y"), +&"intro": SubResource("Animation_d4oe4") +} + +[node name="Intro" type="CanvasLayer" node_paths=PackedStringArray("PanelsHolder", "AnimationPlayer")] script = ExtResource("1_jtu71") PanelsHolder = NodePath("MarginContainer/ImagesContainer") Images = Array[Texture2D]([ExtResource("2_6u3to"), ExtResource("3_5hqyp"), ExtResource("4_845v1"), ExtResource("5_mp1dh"), ExtResource("6_bnr5y"), ExtResource("7_ps628"), ExtResource("8_bnr5y"), ExtResource("9_d4oe4"), ExtResource("10_8r24y"), ExtResource("11_p86nr"), ExtResource("12_paaiq"), ExtResource("13_vtao2"), ExtResource("14_xyh1c"), ExtResource("15_aiaxc"), ExtResource("16_augg6"), ExtResource("17_5dxui")]) TransitionTime = 4.0 NextSceneName = "res://Scenes/MainMenu.tscn" +AnimationPlayer = NodePath("AnimationPlayer") [node name="MarginContainer" type="MarginContainer" parent="."] anchors_preset = 15 @@ -68,6 +487,7 @@ layout_mode = 2 [node name="TextureRect" type="TextureRect" parent="MarginContainer/ImagesContainer"] visible = false +modulate = Color(1, 1, 1, 0) layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 4 @@ -79,7 +499,113 @@ layout_mode = 2 texture = ExtResource("4_845v1") stretch_mode = 5 +[node name="Intro1" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("2_6u3to") +stretch_mode = 5 + +[node name="Intro2" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("3_5hqyp") +stretch_mode = 5 + +[node name="Intro3" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("4_845v1") +stretch_mode = 5 + +[node name="Intro4" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("5_mp1dh") +stretch_mode = 5 + +[node name="Intro5" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("6_bnr5y") +stretch_mode = 5 + +[node name="Intro6" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("7_ps628") +stretch_mode = 5 + +[node name="Intro7" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("8_bnr5y") +stretch_mode = 5 + +[node name="Intro8" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("9_d4oe4") +stretch_mode = 5 + +[node name="Intro9" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("10_8r24y") +stretch_mode = 5 + +[node name="Intro10" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("11_p86nr") +stretch_mode = 5 + +[node name="Intro11" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +clip_contents = true +layout_mode = 2 +texture = ExtResource("12_paaiq") +stretch_mode = 5 + +[node name="Intro11-Crystal" type="TextureRect" parent="MarginContainer/ImagesContainer/Intro11"] +layout_mode = 2 +offset_left = 41.0 +offset_top = 34.0 +offset_right = 89.0 +offset_bottom = 66.0 +texture = ExtResource("19_paaiq") +stretch_mode = 5 + +[node name="Intro12" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("13_vtao2") +stretch_mode = 5 + +[node name="Intro13" type="TextureRect" parent="MarginContainer/ImagesContainer"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 +texture = ExtResource("14_xyh1c") +stretch_mode = 5 + +[node name="Intro14" type="TextureRect" parent="MarginContainer/ImagesContainer"] +layout_mode = 2 +texture = ExtResource("15_aiaxc") +stretch_mode = 5 + +[node name="Intro15" type="TextureRect" parent="MarginContainer/ImagesContainer"] +layout_mode = 2 +texture = ExtResource("16_augg6") +stretch_mode = 5 + [node name="CRT" type="TextureRect" parent="MarginContainer"] material = SubResource("ShaderMaterial_mf5e4") layout_mode = 2 texture = SubResource("GradientTexture2D_bnr5y") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +&"": SubResource("AnimationLibrary_p86nr") +} + +[node name="AudioStreamPlayer2D2" parent="." instance=ExtResource("20_8r24y")] +TrackName = "Intro" diff --git a/Scenes/MainMenu.tscn b/Scenes/MainMenu.tscn index a4df20d7..1bc456b9 100644 --- a/Scenes/MainMenu.tscn +++ b/Scenes/MainMenu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=3 uid="uid://5xajclchk3my"] +[gd_scene load_steps=13 format=3 uid="uid://5xajclchk3my"] [ext_resource type="Script" uid="uid://dql102fvubniv" path="res://Scripts/MainMenu.cs" id="1_702nk"] [ext_resource type="Texture2D" uid="uid://xvadkvwajs0t" path="res://Sprites/UI/Crystal.png" id="2_j4e6a"] @@ -7,6 +7,7 @@ [ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="3_bl0se"] [ext_resource type="AudioStream" uid="uid://di416g5wgx6j0" path="res://Music/Title.mp3" id="4_i6ku4"] [ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="4_nk7wn"] +[ext_resource type="PackedScene" uid="uid://b3tyacxxw88lx" path="res://Scenes/Utils/StreamPlayerWithName.tscn" id="8_koqhg"] [ext_resource type="PackedScene" uid="uid://bemu3l6b1e84y" path="res://Scenes/HUD/debug_menu.tscn" id="9_nwlsr"] [sub_resource type="Theme" id="Theme_c7h4d"] @@ -132,9 +133,11 @@ layout_mode = 2 theme = ExtResource("4_nk7wn") text = "Options" -[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +[node name="AudioStreamPlayer2D" parent="." instance=ExtResource("8_koqhg")] stream = ExtResource("4_i6ku4") autoplay = true +TrackName = "Main Menu" +AuthorName = "Fenekhu" [node name="Panel" type="PanelContainer" parent="."] visible = false diff --git a/Scenes/Utils/StreamPlayerWithName.tscn b/Scenes/Utils/StreamPlayerWithName.tscn new file mode 100644 index 00000000..7355b84a --- /dev/null +++ b/Scenes/Utils/StreamPlayerWithName.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://b3tyacxxw88lx"] + +[ext_resource type="Script" uid="uid://sebnyy6skgsr" path="res://Scripts/UI/AudioNameVisualizer.cs" id="2_ppua0"] +[ext_resource type="PackedScene" uid="uid://dfdagutgntio4" path="res://Scripts/UI/MusicVisualizerCanvas.tscn" id="3_vf84v"] + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D"] +script = ExtResource("2_ppua0") +TrackName = "Track Title" +AuthorName = "Author Name" +CanvasTemplate = ExtResource("3_vf84v") diff --git a/Scripts/Actors/Boss.cs b/Scripts/Actors/Boss.cs index b8523748..be7a6539 100644 --- a/Scripts/Actors/Boss.cs +++ b/Scripts/Actors/Boss.cs @@ -52,6 +52,7 @@ public partial class Boss : Enemy, IActivable _bossHud = BossHudPrefab.Instantiate(); _gameManager.CallDeferred("add_child", _bossHud); + _bossHud.Name = $"{BossName}_BossHud"; _bossHud.Visible = false; _bossHud.BossName = BossName; _bossHud.BossMaxHealth = this.Health; diff --git a/Scripts/UI/AudioNameVisualizer.cs b/Scripts/UI/AudioNameVisualizer.cs new file mode 100644 index 00000000..98b7039f --- /dev/null +++ b/Scripts/UI/AudioNameVisualizer.cs @@ -0,0 +1,60 @@ +using Godot; +using System; +using System.Linq; +using Cirno.Scripts; +using GTweens.Builders; +using GTweens.Easings; +using GTweens.Tweens; +using GTweensGodot.Extensions; + +public partial class AudioNameVisualizer : AudioStreamPlayer2D +{ + [Export] + public string TrackName { get; private set; } + + [Export] + public string AuthorName { get; private set; } + + [Export] public PackedScene CanvasTemplate; + + private MusicVisualizerCanvas _canvasLayer; + + public override void _Ready() + { + Setup(); + + if (Autoplay) + { + ShowName(); + } + } + + private void Setup() + { + var existingCanvas = this.GetTree().Root.GetNodeOrNull("AudioCanvas"); + + if (existingCanvas is null) + { + // _canvasLayer = new CanvasLayer(); + // _canvasLayer.Name = "AudioCanvas"; + _canvasLayer = CanvasTemplate.Instantiate(); + GetTree().Root.CallDeferred("add_child", _canvasLayer); + } + else + { + _canvasLayer = (MusicVisualizerCanvas)existingCanvas; + } + } + + public void PlayWithName() + { + ShowName(); + Play(); + } + + public void ShowName() + { + GD.Print("show name"); + _canvasLayer.ShowName(TrackName, AuthorName); + } +} diff --git a/Scripts/UI/AudioNameVisualizer.cs.uid b/Scripts/UI/AudioNameVisualizer.cs.uid new file mode 100644 index 00000000..0e4a8fd0 --- /dev/null +++ b/Scripts/UI/AudioNameVisualizer.cs.uid @@ -0,0 +1 @@ +uid://sebnyy6skgsr diff --git a/Scripts/UI/IntroScenePlayer.cs b/Scripts/UI/IntroScenePlayer.cs index 119f2b04..e6886f48 100644 --- a/Scripts/UI/IntroScenePlayer.cs +++ b/Scripts/UI/IntroScenePlayer.cs @@ -9,6 +9,8 @@ namespace Cirno.Scripts.UI; public partial class IntroScenePlayer : CanvasLayer { + [Export] public bool StartRunning { get; private set; } + [Export] public Control PanelsHolder { get; private set; } @@ -21,6 +23,9 @@ public partial class IntroScenePlayer : CanvasLayer [Export] public string NextSceneName { get; set; } + [Export] + public AnimationPlayer AnimationPlayer { get; private set; } + private int _currentPanelIndex; private List _panels = new (); @@ -30,12 +35,20 @@ public partial class IntroScenePlayer : CanvasLayer private double _timer = 0f; private bool _running = false; + + private void DeferredStartAnimation() + { + AnimationPlayer.Play("intro"); + } public override void _Ready() { _timer = 0; - _running = true; + _running = StartRunning; + DeferredStartAnimation(); + + return; foreach (var image in Images) { var panel = new TextureRect(); @@ -49,11 +62,19 @@ public partial class IntroScenePlayer : CanvasLayer _panels.Add(panel); } + + if (StartRunning) + { + Run(); + } + } + + public void Run() + { var first = _panels.First(); first.Visible = true; first.SetModulate(new Color(first.Modulate.R, first.Modulate.G, first.Modulate.B, 1f)); - } public override void _Process(double delta) @@ -70,21 +91,26 @@ public partial class IntroScenePlayer : CanvasLayer if (_timer >= TransitionTime) { _timer = 0; - _currentPanelIndex++; - - if (_currentPanelIndex >= _panels.Count) - { - _running = false; - Finished(); - return; - } - - _running = false; - - _ = Transition(); + NextPanel(); } } + public void NextPanel() + { + _currentPanelIndex++; + + if (_currentPanelIndex >= _panels.Count) + { + _running = false; + Finished(); + return; + } + + _running = false; + + _ = Transition(); + } + private void Finished() { GlobalState.Instance.GotoScene(NextSceneName); diff --git a/Scripts/UI/MusicVisualizerCanvas.cs b/Scripts/UI/MusicVisualizerCanvas.cs new file mode 100644 index 00000000..837a33c2 --- /dev/null +++ b/Scripts/UI/MusicVisualizerCanvas.cs @@ -0,0 +1,49 @@ +using Godot; +using System; +using GTweens.Builders; +using GTweens.Easings; +using GTweens.Tweens; +using GTweensGodot.Extensions; + +public partial class MusicVisualizerCanvas : CanvasLayer +{ + private Label _nameLabel; + private GTween _tween; + + public override void _Ready() + { + _nameLabel = GetNode