Skip to content

Commit 24900f8

Browse files
Add menu music & Jarod's menu tweaks I guess
Menu music and title screen finishing touches
2 parents 20d8108 + 4e44b15 commit 24900f8

14 files changed

Lines changed: 240 additions & 34 deletions
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+
}

project.godot

Lines changed: 6 additions & 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

@@ -80,6 +81,11 @@ Inventory={
8081
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":73,"key_label":0,"unicode":105,"location":0,"echo":false,"script":null)
8182
]
8283
}
84+
Secondary={
85+
"deadzone": 0.5,
86+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
87+
]
88+
}
8389

8490
[rendering]
8591

scenes/Maps/scripts/Cartographer.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,21 @@ 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();
1921
GetViewport().GuiFocusChanged += UpdateFocus;
2022
}
2123

24+
public override void _EnterTree()
25+
{
26+
GD.Print("[DEBUG] TitleScreen entered the tree");
27+
_bgPlayer = GetNode<BgAudioPlayer>("/root/BgAudioPlayer");
28+
_bgPlayer.PlayLevelMusic();
29+
}
30+
2231
public override void _Process(double delta)
2332
{
2433
if (!GetTree().Paused && !_validButtons.Contains(GetViewport().GuiGetFocusOwner()))
@@ -121,6 +130,9 @@ private void EnterStage(int roomIdx, Button button)
121130
.TweenProperty(PlayerSprite, "position", button.Position + button.Size * .5f, 1f);
122131
tween.SetTrans(Tween.TransitionType.Back).SetEase(Tween.EaseType.InOut);
123132
tween.Finished += () =>
133+
{
134+
_bgPlayer.StopMusic();
124135
GetNode<StageProducer>("/root/StageProducer").TransitionFromRoom(roomIdx);
136+
};
125137
}
126138
}

scenes/SceneTransitions/TitleScreen.tscn

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
1-
[gd_scene load_steps=17 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"]
45
[ext_resource type="Texture2D" uid="uid://ruxgynq6bc1m" path="res://scenes/SceneTransitions/assets/background.png" id="1_txix1"]
56
[ext_resource type="Texture2D" uid="uid://de2j543j83hmh" path="res://scenes/SceneTransitions/assets/backTree.png" id="2_4luva"]
67
[ext_resource type="Script" path="res://scenes/SceneTransitions/scripts/SceneChange.cs" id="2_7f3m6"]
78
[ext_resource type="Texture2D" uid="uid://b6fkei0i83vte" path="res://scenes/BattleDirector/assets/Character1.png" id="2_cf582"]
9+
[ext_resource type="Texture2D" uid="uid://iqbqsiyjd3uq" path="res://2d_lights_and_shadows_neutral_point_light.webp" id="2_kw6qk"]
810
[ext_resource type="Texture2D" uid="uid://dat1eoyl3do4e" path="res://scenes/SceneTransitions/assets/frontTree.png" id="3_hvvt6"]
911
[ext_resource type="Texture2D" uid="uid://d3rxic3mi8jwb" path="res://scenes/SceneTransitions/assets/midTree.png" id="4_ui8kj"]
1012
[ext_resource type="Texture2D" uid="uid://bj8dxrlwuwrv4" path="res://scenes/SceneTransitions/assets/moon.png" id="5_squvs"]
1113
[ext_resource type="Shader" path="res://scenes/SceneTransitions/assets/transparentStars.gdshader" id="5_x5dhk"]
1214
[ext_resource type="FontFile" uid="uid://dlwfb7kb7pd76" path="res://scenes/SceneTransitions/assets/font.TTF" id="8_gkfev"]
1315
[ext_resource type="Texture2D" uid="uid://hfxynr5jdgsp" path="res://scenes/NoteManager/assets/new_arrow.png" id="10_4hnj8"]
14-
[ext_resource type="AudioStream" uid="uid://co61cvxxakdjs" path="res://scenes/SceneTransitions/assets/song18.mp3" id="11_t7vbg"]
16+
[ext_resource type="Shader" path="res://scenes/SceneTransitions/assets/TitleFont.gdshader" id="11_ht0dv"]
1517
[ext_resource type="PackedScene" uid="uid://bi5iqbwpsd381" path="res://scenes/Puppets/Enemies/BossBlood/Boss1.tscn" id="12_lng3a"]
1618
[ext_resource type="PackedScene" uid="uid://uvlux4t6h5de" path="res://scenes/Puppets/Enemies/Parasifly/Parasifly.tscn" id="13_j3xa4"]
1719

20+
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xhbhh"]
21+
1822
[sub_resource type="ShaderMaterial" id="ShaderMaterial_cbpjr"]
1923
shader = ExtResource("5_x5dhk")
2024
shader_parameter/time_scale = 0.24
2125

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+
2236
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4croe"]
2337
particle_flag_disable_z = true
2438
emission_shape = 3
@@ -28,7 +42,8 @@ hue_variation_min = -1.0
2842
hue_variation_max = 1.0
2943
turbulence_enabled = true
3044

31-
[node name="Title" type="Control"]
45+
[node name="Title" type="Control" node_paths=PackedStringArray("TextLight")]
46+
modulate = Color(0.355314, 0.355314, 0.355314, 1)
3247
layout_mode = 3
3348
anchors_preset = 15
3449
anchor_right = 1.0
@@ -37,6 +52,23 @@ grow_horizontal = 2
3752
grow_vertical = 2
3853
size_flags_horizontal = 3
3954
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
4072

4173
[node name="Background" type="Node2D" parent="."]
4274
position = Vector2(-38, -31)
@@ -55,6 +87,7 @@ texture = ExtResource("2_4luva")
5587

5688
[node name="FrontTree" type="Sprite2D" parent="Background/Art"]
5789
z_index = 1
90+
material = SubResource("ShaderMaterial_xhbhh")
5891
position = Vector2(314, 91)
5992
texture = ExtResource("3_hvvt6")
6093

@@ -67,14 +100,15 @@ position = Vector2(314, 91)
67100
texture = ExtResource("5_squvs")
68101

69102
[node name="Rabb" type="Sprite2D" parent="Background"]
103+
visible = false
70104
z_index = 2
71105
position = Vector2(162.727, 114.091)
72-
scale = Vector2(1, 1)
73106
texture = ExtResource("2_cf582")
74107

75108
[node name="StarShader" type="ColorRect" parent="."]
76109
z_index = -1
77110
material = SubResource("ShaderMaterial_cbpjr")
111+
layout_mode = 0
78112
offset_left = -223.0
79113
offset_top = -200.0
80114
offset_right = 252.0
@@ -113,14 +147,20 @@ layout_mode = 2
113147
visible = false
114148
texture = ExtResource("1_r5xy8")
115149

116-
[node name="Label" type="Label" parent="VBoxContainer/MarginContainer/Control"]
150+
[node name="Title" type="Label" parent="VBoxContainer/MarginContainer/Control"]
151+
light_mask = 2
117152
z_index = 10
153+
material = SubResource("ShaderMaterial_4cy5c")
118154
layout_mode = 2
155+
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
119156
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
120-
theme_override_constants/outline_size = 13
157+
theme_override_constants/shadow_offset_x = 4
158+
theme_override_constants/shadow_offset_y = 5
121159
theme_override_fonts/font = ExtResource("8_gkfev")
122-
theme_override_font_sizes/font_size = 57
123-
text = "Funk Engine"
160+
theme_override_font_sizes/font_size = 55
161+
text = "Midnight Riff"
162+
horizontal_alignment = 1
163+
vertical_alignment = 1
124164

125165
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
126166
layout_mode = 2
@@ -183,17 +223,15 @@ text = "Change Controls"
183223
script = ExtResource("2_7f3m6")
184224
ScenePath = 6
185225

186-
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
187-
stream = ExtResource("11_t7vbg")
188-
autoplay = true
189-
190226
[node name="EnemPuppet" parent="." instance=ExtResource("12_lng3a")]
227+
visible = false
191228
position = Vector2(37, 186)
192229
StartPos = Vector2(40, 150)
193230
InitScale = Vector2(1, 1)
194231
hideHealth = true
195232

196233
[node name="EnemPuppet2" parent="." instance=ExtResource("13_j3xa4")]
234+
visible = false
197235
position = Vector2(572, 167)
198236
StartPos = Vector2(572, 167)
199237
hideHealth = true
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+
//}

scenes/SceneTransitions/assets/font.TTF.import

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/font.TTF-d7f862dc1f5e4b5cfedf614b37a87c94.fon
1313
[params]
1414

1515
Rendering=null
16-
antialiasing=1
16+
antialiasing=0
1717
generate_mipmaps=false
1818
disable_embedded_bitmaps=true
1919
multichannel_signed_distance_field=false
@@ -22,7 +22,7 @@ msdf_size=48
2222
allow_system_fallback=true
2323
force_autohinter=false
2424
hinting=1
25-
subpixel_positioning=1
25+
subpixel_positioning=0
2626
oversampling=0.0
2727
Fallbacks=null
2828
fallbacks=[]
@@ -32,7 +32,8 @@ preload=[{
3232
"chars": [],
3333
"glyphs": [],
3434
"name": "New Configuration",
35-
"size": Vector2i(16, 0)
35+
"size": Vector2i(16, 0),
36+
"variation_embolden": 0.0
3637
}]
3738
language_support={}
3839
script_support={}
-522 KB
Binary file not shown.

0 commit comments

Comments
 (0)