Skip to content

Commit 407be5a

Browse files
authored
Merge pull request #82 from Project-Funk-Engine/mainMenu
Finalize title screen design and add music that plays across scenes
2 parents 07aeca2 + 3b81e7b commit 407be5a

26 files changed

+567
-10
lines changed
28 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://iqbqsiyjd3uq"
6+
path="res://.godot/imported/2d_lights_and_shadows_neutral_point_light.webp-65502514064ef8af4bce05336c6482e4.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://2d_lights_and_shadows_neutral_point_light.webp"
14+
dest_files=["res://.godot/imported/2d_lights_and_shadows_neutral_point_light.webp-65502514064ef8af4bce05336c6482e4.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1

Globals/BGAudioPlayer.tscn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[gd_scene load_steps=2 format=3 uid="uid://csx04jwaoo20u"]
2+
3+
[ext_resource type="Script" path="res://Globals/BgAudioPlayer.cs" id="1_w7def"]
4+
5+
[node name="BgAudioPlayer" type="AudioStreamPlayer"]
6+
script = ExtResource("1_w7def")

Globals/BgAudioPlayer.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Godot;
2+
3+
public partial class BgAudioPlayer : AudioStreamPlayer
4+
{
5+
private readonly AudioStream _levelMusic = (AudioStream)
6+
ResourceLoader.Load("res://scenes/SceneTransitions/assets/titleSong.ogg");
7+
8+
private void PlayMusic(AudioStream music, float volume)
9+
{
10+
if (Playing && music.Equals(Stream))
11+
{
12+
return;
13+
}
14+
15+
Stream = music;
16+
VolumeDb = volume;
17+
Play();
18+
}
19+
20+
public void PlayLevelMusic(float volume = -10f)
21+
{
22+
PlayMusic(_levelMusic, volume);
23+
}
24+
25+
public void StopMusic()
26+
{
27+
Stop();
28+
Stream = null;
29+
}
30+
}

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ Current team members include:
1616

1717

1818
#### Attributions:
19-
First Song: <a href="https://freesound.org/people/Magntron/sounds/335571/" title="gameMusic">gameMusic by Magntron - freesound.org</a>
20-
Input buttons by <a href="https://thoseawesomeguys.com/prompts/" title="inputkeys">Nicolae (Xelu) Berbece</a>
19+
Music:
20+
- Title Screen: [Crystal Cave - Cynicmusic](https://opengameart.org/content/crystal-cave-song18)
21+
- Battle Song 1: [gameMusic - Magntron](https://freesound.org/people/Magntron/sounds/335571/)
22+
23+
Images:
24+
- Input Buttons: [inputKeys - Nicolae (Xelu) Berbece](https://thoseawesomeguys.com/prompts/)

project.godot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ config/icon="res://scenes/BattleDirector/assets/Character1.png"
2020
TimeKeeper="*res://Globals/TimeKeeper.cs"
2121
Scribe="*res://Globals/Scribe.cs"
2222
StageProducer="*res://Globals/StageProducer.cs"
23+
BgAudioPlayer="*res://Globals/BGAudioPlayer.tscn"
2324

2425
[display]
2526

scenes/Maps/scripts/Cartographer.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public partial class Cartographer : Node2D
1313
[Export]
1414
private Button _focusedButton = null;
1515

16+
private BgAudioPlayer _bgPlayer;
17+
1618
public override void _Ready()
1719
{
1820
DrawMap();
@@ -23,6 +25,13 @@ public override void _Ready()
2325
}
2426
}
2527

28+
public override void _EnterTree()
29+
{
30+
GD.Print("[DEBUG] TitleScreen entered the tree");
31+
_bgPlayer = GetNode<BgAudioPlayer>("/root/BgAudioPlayer");
32+
_bgPlayer.PlayLevelMusic();
33+
}
34+
2635
public override void _Process(double delta)
2736
{
2837
if (!GetTree().Paused && !_validButtons.Contains(GetViewport().GuiGetFocusOwner()))
@@ -125,7 +134,10 @@ private void EnterStage(int roomIdx, Button button)
125134
.TweenProperty(PlayerSprite, "position", button.Position + button.Size * .5f, 1f);
126135
tween.SetTrans(Tween.TransitionType.Back).SetEase(Tween.EaseType.InOut);
127136
tween.Finished += () =>
137+
{
138+
_bgPlayer.StopMusic();
128139
GetNode<StageProducer>("/root/StageProducer").TransitionFromRoom(roomIdx);
140+
};
129141
}
130142

131143
private void WinStage()

scenes/Puppets/scripts/PuppetTemplate.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public partial class PuppetTemplate : Node2D
2121
[Export]
2222
public Vector2 InitScale = Vector2.One;
2323

24+
[Export]
25+
public bool hideHealth = false;
26+
2427
protected int _maxHealth = 100;
2528
protected int _currentHealth = 100;
2629

@@ -33,6 +36,11 @@ public override void _Ready()
3336
_healthBar.SetHealth(_maxHealth, _currentHealth);
3437
Position = StartPos;
3538
Sprite.Scale = InitScale;
39+
40+
if (hideHealth)
41+
{
42+
_healthBar.Hide();
43+
}
3644
}
3745

3846
public void Init(Texture2D texture, string name)

scenes/SceneTransitions/TitleScreen.tscn

Lines changed: 142 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,49 @@
1-
[gd_scene load_steps=4 format=3 uid="uid://bm41yti6ij2j"]
1+
[gd_scene load_steps=21 format=3 uid="uid://bm41yti6ij2j"]
22

33
[ext_resource type="Texture2D" uid="uid://b0tvsewgnf2x7" path="res://icon.svg" id="1_r5xy8"]
4+
[ext_resource type="Script" path="res://scenes/SceneTransitions/scripts/TitleScreen.cs" id="1_r22ha"]
5+
[ext_resource type="Texture2D" uid="uid://ruxgynq6bc1m" path="res://scenes/SceneTransitions/assets/background.png" id="1_txix1"]
6+
[ext_resource type="Texture2D" uid="uid://de2j543j83hmh" path="res://scenes/SceneTransitions/assets/backTree.png" id="2_4luva"]
47
[ext_resource type="Script" path="res://scenes/SceneTransitions/scripts/SceneChange.cs" id="2_7f3m6"]
58
[ext_resource type="Texture2D" uid="uid://b6fkei0i83vte" path="res://scenes/BattleDirector/assets/Character1.png" id="2_cf582"]
6-
7-
[node name="Title" type="Control"]
9+
[ext_resource type="Texture2D" uid="uid://iqbqsiyjd3uq" path="res://2d_lights_and_shadows_neutral_point_light.webp" id="2_kw6qk"]
10+
[ext_resource type="Texture2D" uid="uid://dat1eoyl3do4e" path="res://scenes/SceneTransitions/assets/frontTree.png" id="3_hvvt6"]
11+
[ext_resource type="Texture2D" uid="uid://d3rxic3mi8jwb" path="res://scenes/SceneTransitions/assets/midTree.png" id="4_ui8kj"]
12+
[ext_resource type="Texture2D" uid="uid://bj8dxrlwuwrv4" path="res://scenes/SceneTransitions/assets/moon.png" id="5_squvs"]
13+
[ext_resource type="Shader" path="res://scenes/SceneTransitions/assets/transparentStars.gdshader" id="5_x5dhk"]
14+
[ext_resource type="FontFile" uid="uid://dlwfb7kb7pd76" path="res://scenes/SceneTransitions/assets/font.TTF" id="8_gkfev"]
15+
[ext_resource type="Texture2D" uid="uid://hfxynr5jdgsp" path="res://scenes/NoteManager/assets/new_arrow.png" id="10_4hnj8"]
16+
[ext_resource type="Shader" path="res://scenes/SceneTransitions/assets/TitleFont.gdshader" id="11_ht0dv"]
17+
[ext_resource type="PackedScene" uid="uid://bi5iqbwpsd381" path="res://scenes/Puppets/Enemies/BossBlood/Boss1.tscn" id="12_lng3a"]
18+
[ext_resource type="PackedScene" uid="uid://uvlux4t6h5de" path="res://scenes/Puppets/Enemies/Parasifly/Parasifly.tscn" id="13_j3xa4"]
19+
20+
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xhbhh"]
21+
22+
[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbpjr"]
23+
shader = ExtResource("5_x5dhk")
24+
shader_parameter/time_scale = 0.24
25+
26+
[sub_resource type="ShaderMaterial" id="ShaderMaterial_4cy5c"]
27+
shader = ExtResource("11_ht0dv")
28+
shader_parameter/height = 10.0
29+
shader_parameter/speed = 2.0
30+
shader_parameter/freq = 10.0
31+
shader_parameter/bg_top_color = null
32+
shader_parameter/bg_bottom_color = null
33+
shader_parameter/gradient_ratio = 0.0
34+
shader_parameter/time_scale = null
35+
36+
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4croe"]
37+
particle_flag_disable_z = true
38+
emission_shape = 3
39+
emission_box_extents = Vector3(2.4, 5, 1)
40+
gravity = Vector3(-180, 0, 0)
41+
hue_variation_min = -1.0
42+
hue_variation_max = 1.0
43+
turbulence_enabled = true
44+
45+
[node name="Title" type="Control" node_paths=PackedStringArray("TextLight")]
46+
modulate = Color(0.355314, 0.355314, 0.355314, 1)
847
layout_mode = 3
948
anchors_preset = 15
1049
anchor_right = 1.0
@@ -13,6 +52,69 @@ grow_horizontal = 2
1352
grow_vertical = 2
1453
size_flags_horizontal = 3
1554
size_flags_vertical = 3
55+
script = ExtResource("1_r22ha")
56+
TextLight = NodePath("TextLight")
57+
58+
[node name="MoonLight" type="PointLight2D" parent="."]
59+
position = Vector2(363, 37)
60+
energy = 2.0
61+
texture = ExtResource("2_kw6qk")
62+
texture_scale = 3.0
63+
64+
[node name="TextLight" type="PointLight2D" parent="."]
65+
position = Vector2(320, 100)
66+
scale = Vector2(6, 2)
67+
color = Color(0.560784, 0, 1, 1)
68+
energy = 2.0
69+
range_item_cull_mask = 3
70+
texture = ExtResource("2_kw6qk")
71+
texture_scale = 0.5
72+
73+
[node name="Background" type="Node2D" parent="."]
74+
position = Vector2(-38, -31)
75+
scale = Vector2(2.2, 2.2)
76+
77+
[node name="Art" type="Node2D" parent="Background"]
78+
79+
[node name="Background" type="Sprite2D" parent="Background/Art"]
80+
z_index = -2
81+
position = Vector2(314, 91)
82+
texture = ExtResource("1_txix1")
83+
84+
[node name="BackTree" type="Sprite2D" parent="Background/Art"]
85+
position = Vector2(314, 91)
86+
texture = ExtResource("2_4luva")
87+
88+
[node name="FrontTree" type="Sprite2D" parent="Background/Art"]
89+
z_index = 1
90+
material = SubResource("ShaderMaterial_xhbhh")
91+
position = Vector2(314, 91)
92+
texture = ExtResource("3_hvvt6")
93+
94+
[node name="MidTree" type="Sprite2D" parent="Background/Art"]
95+
position = Vector2(314, 91)
96+
texture = ExtResource("4_ui8kj")
97+
98+
[node name="Moon" type="Sprite2D" parent="Background/Art"]
99+
position = Vector2(314, 91)
100+
texture = ExtResource("5_squvs")
101+
102+
[node name="Rabb" type="Sprite2D" parent="Background"]
103+
visible = false
104+
z_index = 2
105+
position = Vector2(162.727, 114.091)
106+
texture = ExtResource("2_cf582")
107+
108+
[node name="StarShader" type="ColorRect" parent="."]
109+
z_index = -1
110+
material = SubResource("ShaderMaterial_cbpjr")
111+
layout_mode = 0
112+
offset_left = -223.0
113+
offset_top = -200.0
114+
offset_right = 252.0
115+
offset_bottom = -23.0
116+
scale = Vector2(3.78, 3.82)
117+
color = Color(0, 0, 0, 1)
16118

17119
[node name="SecretLabel" type="Label" parent="."]
18120
visible = false
@@ -22,6 +124,7 @@ offset_bottom = 23.0
22124
text = "(Control nodes are fucking weird weird.)"
23125

24126
[node name="VBoxContainer" type="VBoxContainer" parent="."]
127+
z_index = 4
25128
layout_mode = 1
26129
anchors_preset = 15
27130
anchor_right = 1.0
@@ -41,14 +144,23 @@ layout_mode = 2
41144
layout_mode = 2
42145

43146
[node name="Godot" type="Sprite2D" parent="VBoxContainer/MarginContainer/Control/Control"]
147+
visible = false
44148
texture = ExtResource("1_r5xy8")
45149

46-
[node name="Rabb" type="Sprite2D" parent="VBoxContainer/MarginContainer/Control/Control"]
47-
texture = ExtResource("2_cf582")
48-
49-
[node name="Label" type="Label" parent="VBoxContainer/MarginContainer/Control"]
150+
[node name="Title" type="Label" parent="VBoxContainer/MarginContainer/Control"]
151+
light_mask = 2
152+
z_index = 10
153+
material = SubResource("ShaderMaterial_4cy5c")
50154
layout_mode = 2
51-
text = "Insert Title Screen Here"
155+
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
156+
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
157+
theme_override_constants/shadow_offset_x = 4
158+
theme_override_constants/shadow_offset_y = 5
159+
theme_override_fonts/font = ExtResource("8_gkfev")
160+
theme_override_font_sizes/font_size = 55
161+
text = "Midnight Riff"
162+
horizontal_alignment = 1
163+
vertical_alignment = 1
52164

53165
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
54166
layout_mode = 2
@@ -110,3 +222,25 @@ layout_mode = 2
110222
text = "Change Controls"
111223
script = ExtResource("2_7f3m6")
112224
ScenePath = 6
225+
226+
[node name="EnemPuppet" parent="." instance=ExtResource("12_lng3a")]
227+
visible = false
228+
position = Vector2(37, 186)
229+
StartPos = Vector2(40, 150)
230+
InitScale = Vector2(1, 1)
231+
hideHealth = true
232+
233+
[node name="EnemPuppet2" parent="." instance=ExtResource("13_j3xa4")]
234+
visible = false
235+
position = Vector2(572, 167)
236+
StartPos = Vector2(572, 167)
237+
hideHealth = true
238+
239+
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
240+
z_index = -1
241+
z_as_relative = false
242+
position = Vector2(643, 154)
243+
process_material = SubResource("ParticleProcessMaterial_4croe")
244+
texture = ExtResource("10_4hnj8")
245+
lifetime = 15.0
246+
randomness = 1.0
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
shader_type canvas_item;
2+
3+
uniform float height = 5.0;
4+
uniform float speed = 5.0f;
5+
uniform float freq = 10.0f;
6+
7+
uniform vec3 bg_top_color;
8+
uniform vec3 bg_bottom_color;
9+
uniform float gradient_ratio;
10+
uniform float time_scale;
11+
12+
float rand(vec2 st) {
13+
return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);
14+
}
15+
16+
void vertex() {
17+
// Called for every vertex the material is visible on.
18+
VERTEX.y -= height * sin((TIME * speed) + (freq * UV.x));
19+
}
20+
21+
void fragment() {
22+
23+
float color = 0.0f;
24+
25+
if (COLOR.rgb == vec3(1)){
26+
if (rand(SCREEN_UV.xy / 20.0) > 0.996){
27+
COLOR.rbg = vec3(1);
28+
}else {
29+
vec3 gradient = mix(bg_top_color, bg_bottom_color, SCREEN_UV.y / gradient_ratio);
30+
COLOR.rgb = gradient;
31+
}
32+
/*
33+
if (rand(SCREEN_UV.xy / 20.0) > 0.996)
34+
{
35+
float r = rand(SCREEN_UV.xy);
36+
color = r * (0.85 * sin((TIME * time_scale) * (r * 5.0) + 720.0 * r) + 0.95);
37+
}
38+
39+
vec4 gradient_color = mix(bg_top_color, bg_bottom_color, SCREEN_UV.y / gradient_ratio);
40+
COLOR = vec4(vec3(color),1.0) + gradient_color;
41+
*/
42+
43+
44+
}
45+
// Called for every pixel the material is visible on.
46+
}
47+
48+
//void light() {
49+
// Called for every pixel for every light affecting the CanvasItem.
50+
// Uncomment to replace the default light processing function with this one.
51+
//}

0 commit comments

Comments
 (0)