diff --git a/2d_lights_and_shadows_neutral_point_light.webp b/2d_lights_and_shadows_neutral_point_light.webp new file mode 100644 index 00000000..e71af9f1 Binary files /dev/null and b/2d_lights_and_shadows_neutral_point_light.webp differ diff --git a/2d_lights_and_shadows_neutral_point_light.webp.import b/2d_lights_and_shadows_neutral_point_light.webp.import new file mode 100644 index 00000000..a65bf9d5 --- /dev/null +++ b/2d_lights_and_shadows_neutral_point_light.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://iqbqsiyjd3uq" +path="res://.godot/imported/2d_lights_and_shadows_neutral_point_light.webp-65502514064ef8af4bce05336c6482e4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://2d_lights_and_shadows_neutral_point_light.webp" +dest_files=["res://.godot/imported/2d_lights_and_shadows_neutral_point_light.webp-65502514064ef8af4bce05336c6482e4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Globals/BGAudioPlayer.tscn b/Globals/BGAudioPlayer.tscn new file mode 100644 index 00000000..932b5464 --- /dev/null +++ b/Globals/BGAudioPlayer.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://csx04jwaoo20u"] + +[ext_resource type="Script" path="res://Globals/BgAudioPlayer.cs" id="1_w7def"] + +[node name="BgAudioPlayer" type="AudioStreamPlayer"] +script = ExtResource("1_w7def") diff --git a/Globals/BgAudioPlayer.cs b/Globals/BgAudioPlayer.cs new file mode 100644 index 00000000..95fae32a --- /dev/null +++ b/Globals/BgAudioPlayer.cs @@ -0,0 +1,30 @@ +using Godot; + +public partial class BgAudioPlayer : AudioStreamPlayer +{ + private readonly AudioStream _levelMusic = (AudioStream) + ResourceLoader.Load("res://scenes/SceneTransitions/assets/titleSong.ogg"); + + private void PlayMusic(AudioStream music, float volume) + { + if (Playing && music.Equals(Stream)) + { + return; + } + + Stream = music; + VolumeDb = volume; + Play(); + } + + public void PlayLevelMusic(float volume = -10f) + { + PlayMusic(_levelMusic, volume); + } + + public void StopMusic() + { + Stop(); + Stream = null; + } +} diff --git a/project.godot b/project.godot index 53b7e2a2..d98a7e8c 100644 --- a/project.godot +++ b/project.godot @@ -20,6 +20,7 @@ config/icon="res://scenes/BattleDirector/assets/Character1.png" TimeKeeper="*res://Globals/TimeKeeper.cs" Scribe="*res://Globals/Scribe.cs" StageProducer="*res://Globals/StageProducer.cs" +BgAudioPlayer="*res://Globals/BGAudioPlayer.tscn" [display] @@ -80,6 +81,11 @@ Inventory={ "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) ] } +Secondary={ +"deadzone": 0.5, +"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) +] +} [rendering] diff --git a/scenes/Maps/scripts/Cartographer.cs b/scenes/Maps/scripts/Cartographer.cs index 545c9b88..03238ef2 100644 --- a/scenes/Maps/scripts/Cartographer.cs +++ b/scenes/Maps/scripts/Cartographer.cs @@ -13,12 +13,21 @@ public partial class Cartographer : Node2D [Export] private Button _focusedButton = null; + private BgAudioPlayer _bgPlayer; + public override void _Ready() { DrawMap(); GetViewport().GuiFocusChanged += UpdateFocus; } + public override void _EnterTree() + { + GD.Print("[DEBUG] TitleScreen entered the tree"); + _bgPlayer = GetNode("/root/BgAudioPlayer"); + _bgPlayer.PlayLevelMusic(); + } + public override void _Process(double delta) { if (!GetTree().Paused && !_validButtons.Contains(GetViewport().GuiGetFocusOwner())) @@ -121,6 +130,9 @@ private void EnterStage(int roomIdx, Button button) .TweenProperty(PlayerSprite, "position", button.Position + button.Size * .5f, 1f); tween.SetTrans(Tween.TransitionType.Back).SetEase(Tween.EaseType.InOut); tween.Finished += () => + { + _bgPlayer.StopMusic(); GetNode("/root/StageProducer").TransitionFromRoom(roomIdx); + }; } } diff --git a/scenes/SceneTransitions/TitleScreen.tscn b/scenes/SceneTransitions/TitleScreen.tscn index c585d283..ac6aaff1 100644 --- a/scenes/SceneTransitions/TitleScreen.tscn +++ b/scenes/SceneTransitions/TitleScreen.tscn @@ -1,24 +1,38 @@ -[gd_scene load_steps=17 format=3 uid="uid://bm41yti6ij2j"] +[gd_scene load_steps=21 format=3 uid="uid://bm41yti6ij2j"] [ext_resource type="Texture2D" uid="uid://b0tvsewgnf2x7" path="res://icon.svg" id="1_r5xy8"] +[ext_resource type="Script" path="res://scenes/SceneTransitions/scripts/TitleScreen.cs" id="1_r22ha"] [ext_resource type="Texture2D" uid="uid://ruxgynq6bc1m" path="res://scenes/SceneTransitions/assets/background.png" id="1_txix1"] [ext_resource type="Texture2D" uid="uid://de2j543j83hmh" path="res://scenes/SceneTransitions/assets/backTree.png" id="2_4luva"] [ext_resource type="Script" path="res://scenes/SceneTransitions/scripts/SceneChange.cs" id="2_7f3m6"] [ext_resource type="Texture2D" uid="uid://b6fkei0i83vte" path="res://scenes/BattleDirector/assets/Character1.png" id="2_cf582"] +[ext_resource type="Texture2D" uid="uid://iqbqsiyjd3uq" path="res://2d_lights_and_shadows_neutral_point_light.webp" id="2_kw6qk"] [ext_resource type="Texture2D" uid="uid://dat1eoyl3do4e" path="res://scenes/SceneTransitions/assets/frontTree.png" id="3_hvvt6"] [ext_resource type="Texture2D" uid="uid://d3rxic3mi8jwb" path="res://scenes/SceneTransitions/assets/midTree.png" id="4_ui8kj"] [ext_resource type="Texture2D" uid="uid://bj8dxrlwuwrv4" path="res://scenes/SceneTransitions/assets/moon.png" id="5_squvs"] [ext_resource type="Shader" path="res://scenes/SceneTransitions/assets/transparentStars.gdshader" id="5_x5dhk"] [ext_resource type="FontFile" uid="uid://dlwfb7kb7pd76" path="res://scenes/SceneTransitions/assets/font.TTF" id="8_gkfev"] [ext_resource type="Texture2D" uid="uid://hfxynr5jdgsp" path="res://scenes/NoteManager/assets/new_arrow.png" id="10_4hnj8"] -[ext_resource type="AudioStream" uid="uid://co61cvxxakdjs" path="res://scenes/SceneTransitions/assets/song18.mp3" id="11_t7vbg"] +[ext_resource type="Shader" path="res://scenes/SceneTransitions/assets/TitleFont.gdshader" id="11_ht0dv"] [ext_resource type="PackedScene" uid="uid://bi5iqbwpsd381" path="res://scenes/Puppets/Enemies/BossBlood/Boss1.tscn" id="12_lng3a"] [ext_resource type="PackedScene" uid="uid://uvlux4t6h5de" path="res://scenes/Puppets/Enemies/Parasifly/Parasifly.tscn" id="13_j3xa4"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_xhbhh"] + [sub_resource type="ShaderMaterial" id="ShaderMaterial_cbpjr"] shader = ExtResource("5_x5dhk") shader_parameter/time_scale = 0.24 +[sub_resource type="ShaderMaterial" id="ShaderMaterial_4cy5c"] +shader = ExtResource("11_ht0dv") +shader_parameter/height = 10.0 +shader_parameter/speed = 2.0 +shader_parameter/freq = 10.0 +shader_parameter/bg_top_color = null +shader_parameter/bg_bottom_color = null +shader_parameter/gradient_ratio = 0.0 +shader_parameter/time_scale = null + [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4croe"] particle_flag_disable_z = true emission_shape = 3 @@ -28,7 +42,8 @@ hue_variation_min = -1.0 hue_variation_max = 1.0 turbulence_enabled = true -[node name="Title" type="Control"] +[node name="Title" type="Control" node_paths=PackedStringArray("TextLight")] +modulate = Color(0.355314, 0.355314, 0.355314, 1) layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -37,6 +52,23 @@ grow_horizontal = 2 grow_vertical = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +script = ExtResource("1_r22ha") +TextLight = NodePath("TextLight") + +[node name="MoonLight" type="PointLight2D" parent="."] +position = Vector2(363, 37) +energy = 2.0 +texture = ExtResource("2_kw6qk") +texture_scale = 3.0 + +[node name="TextLight" type="PointLight2D" parent="."] +position = Vector2(320, 100) +scale = Vector2(6, 2) +color = Color(0.560784, 0, 1, 1) +energy = 2.0 +range_item_cull_mask = 3 +texture = ExtResource("2_kw6qk") +texture_scale = 0.5 [node name="Background" type="Node2D" parent="."] position = Vector2(-38, -31) @@ -55,6 +87,7 @@ texture = ExtResource("2_4luva") [node name="FrontTree" type="Sprite2D" parent="Background/Art"] z_index = 1 +material = SubResource("ShaderMaterial_xhbhh") position = Vector2(314, 91) texture = ExtResource("3_hvvt6") @@ -67,14 +100,15 @@ position = Vector2(314, 91) texture = ExtResource("5_squvs") [node name="Rabb" type="Sprite2D" parent="Background"] +visible = false z_index = 2 position = Vector2(162.727, 114.091) -scale = Vector2(1, 1) texture = ExtResource("2_cf582") [node name="StarShader" type="ColorRect" parent="."] z_index = -1 material = SubResource("ShaderMaterial_cbpjr") +layout_mode = 0 offset_left = -223.0 offset_top = -200.0 offset_right = 252.0 @@ -113,14 +147,20 @@ layout_mode = 2 visible = false texture = ExtResource("1_r5xy8") -[node name="Label" type="Label" parent="VBoxContainer/MarginContainer/Control"] +[node name="Title" type="Label" parent="VBoxContainer/MarginContainer/Control"] +light_mask = 2 z_index = 10 +material = SubResource("ShaderMaterial_4cy5c") layout_mode = 2 +theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 13 +theme_override_constants/shadow_offset_x = 4 +theme_override_constants/shadow_offset_y = 5 theme_override_fonts/font = ExtResource("8_gkfev") -theme_override_font_sizes/font_size = 57 -text = "Funk Engine" +theme_override_font_sizes/font_size = 55 +text = "Midnight Riff" +horizontal_alignment = 1 +vertical_alignment = 1 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] layout_mode = 2 @@ -183,17 +223,15 @@ text = "Change Controls" script = ExtResource("2_7f3m6") ScenePath = 6 -[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] -stream = ExtResource("11_t7vbg") -autoplay = true - [node name="EnemPuppet" parent="." instance=ExtResource("12_lng3a")] +visible = false position = Vector2(37, 186) StartPos = Vector2(40, 150) InitScale = Vector2(1, 1) hideHealth = true [node name="EnemPuppet2" parent="." instance=ExtResource("13_j3xa4")] +visible = false position = Vector2(572, 167) StartPos = Vector2(572, 167) hideHealth = true diff --git a/scenes/SceneTransitions/assets/TitleFont.gdshader b/scenes/SceneTransitions/assets/TitleFont.gdshader new file mode 100644 index 00000000..338546fb --- /dev/null +++ b/scenes/SceneTransitions/assets/TitleFont.gdshader @@ -0,0 +1,51 @@ +shader_type canvas_item; + +uniform float height = 5.0; +uniform float speed = 5.0f; +uniform float freq = 10.0f; + +uniform vec3 bg_top_color; +uniform vec3 bg_bottom_color; +uniform float gradient_ratio; +uniform float time_scale; + +float rand(vec2 st) { + return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123); +} + +void vertex() { + // Called for every vertex the material is visible on. + VERTEX.y -= height * sin((TIME * speed) + (freq * UV.x)); +} + +void fragment() { + + float color = 0.0f; + + if (COLOR.rgb == vec3(1)){ + if (rand(SCREEN_UV.xy / 20.0) > 0.996){ + COLOR.rbg = vec3(1); + }else { + vec3 gradient = mix(bg_top_color, bg_bottom_color, SCREEN_UV.y / gradient_ratio); + COLOR.rgb = gradient; + } + /* + if (rand(SCREEN_UV.xy / 20.0) > 0.996) + { + float r = rand(SCREEN_UV.xy); + color = r * (0.85 * sin((TIME * time_scale) * (r * 5.0) + 720.0 * r) + 0.95); + } + + vec4 gradient_color = mix(bg_top_color, bg_bottom_color, SCREEN_UV.y / gradient_ratio); + COLOR = vec4(vec3(color),1.0) + gradient_color; + */ + + + } + // Called for every pixel the material is visible on. +} + +//void light() { + // Called for every pixel for every light affecting the CanvasItem. + // Uncomment to replace the default light processing function with this one. +//} diff --git a/scenes/SceneTransitions/assets/font.TTF.import b/scenes/SceneTransitions/assets/font.TTF.import index 101a6830..bb476e0a 100644 --- a/scenes/SceneTransitions/assets/font.TTF.import +++ b/scenes/SceneTransitions/assets/font.TTF.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/font.TTF-d7f862dc1f5e4b5cfedf614b37a87c94.fon [params] Rendering=null -antialiasing=1 +antialiasing=0 generate_mipmaps=false disable_embedded_bitmaps=true multichannel_signed_distance_field=false @@ -22,7 +22,7 @@ msdf_size=48 allow_system_fallback=true force_autohinter=false hinting=1 -subpixel_positioning=1 +subpixel_positioning=0 oversampling=0.0 Fallbacks=null fallbacks=[] @@ -32,7 +32,8 @@ preload=[{ "chars": [], "glyphs": [], "name": "New Configuration", -"size": Vector2i(16, 0) +"size": Vector2i(16, 0), +"variation_embolden": 0.0 }] language_support={} script_support={} diff --git a/scenes/SceneTransitions/assets/song18.mp3 b/scenes/SceneTransitions/assets/song18.mp3 deleted file mode 100644 index 4964aeff..00000000 Binary files a/scenes/SceneTransitions/assets/song18.mp3 and /dev/null differ diff --git a/scenes/SceneTransitions/assets/song18.mp3.import b/scenes/SceneTransitions/assets/song18.mp3.import deleted file mode 100644 index 5c1cb791..00000000 --- a/scenes/SceneTransitions/assets/song18.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://co61cvxxakdjs" -path="res://.godot/imported/song18.mp3-4419f78f9e1e14c8dea4e7809fcefa01.mp3str" - -[deps] - -source_file="res://scenes/SceneTransitions/assets/song18.mp3" -dest_files=["res://.godot/imported/song18.mp3-4419f78f9e1e14c8dea4e7809fcefa01.mp3str"] - -[params] - -loop=true -loop_offset=0.0 -bpm=0.0 -beat_count=0 -bar_beats=4 diff --git a/scenes/SceneTransitions/assets/titleSong.ogg b/scenes/SceneTransitions/assets/titleSong.ogg new file mode 100644 index 00000000..5a8cda99 Binary files /dev/null and b/scenes/SceneTransitions/assets/titleSong.ogg differ diff --git a/scenes/SceneTransitions/assets/titleSong.ogg.import b/scenes/SceneTransitions/assets/titleSong.ogg.import new file mode 100644 index 00000000..0c631fc5 --- /dev/null +++ b/scenes/SceneTransitions/assets/titleSong.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://b52r6rgf4qsdr" +path="res://.godot/imported/titleSong.ogg-9b2a968ab90fbc0d5b93d6100fb323d4.oggvorbisstr" + +[deps] + +source_file="res://scenes/SceneTransitions/assets/titleSong.ogg" +dest_files=["res://.godot/imported/titleSong.ogg-9b2a968ab90fbc0d5b93d6100fb323d4.oggvorbisstr"] + +[params] + +loop=true +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/scenes/SceneTransitions/scripts/TitleScreen.cs b/scenes/SceneTransitions/scripts/TitleScreen.cs new file mode 100644 index 00000000..a9b1e91a --- /dev/null +++ b/scenes/SceneTransitions/scripts/TitleScreen.cs @@ -0,0 +1,28 @@ +using System; +using Godot; + +public partial class TitleScreen : Control +{ + [Export] + public PointLight2D TextLight; + + public override void _Ready() + { + TweenLight(); + } + + private void TweenLight() + { + var tween = CreateTween(); + tween.SetTrans(Tween.TransitionType.Linear); + tween.TweenProperty(TextLight, "energy", 7, 5f); + tween.TweenProperty(TextLight, "energy", 2, 5f); + tween.SetLoops(-1); + tween.Play(); + } + + public override void _EnterTree() + { + GetNode("/root/BgAudioPlayer").PlayLevelMusic(); + } +}