Placeholder music
This commit is contained in:
BIN
Audio/BGM/02 MovinOn.mp3
Normal file
BIN
Audio/BGM/02 MovinOn.mp3
Normal file
Binary file not shown.
19
Audio/BGM/02 MovinOn.mp3.import
Normal file
19
Audio/BGM/02 MovinOn.mp3.import
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="mp3"
|
||||||
|
type="AudioStreamMP3"
|
||||||
|
uid="uid://cp787gdbhccb1"
|
||||||
|
path="res://.godot/imported/02 MovinOn.mp3-9ee085070ee763b5e5fda860f33a13f2.mp3str"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Audio/BGM/02 MovinOn.mp3"
|
||||||
|
dest_files=["res://.godot/imported/02 MovinOn.mp3-9ee085070ee763b5e5fda860f33a13f2.mp3str"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
17
Scripts/BGMPlayer.cs
Normal file
17
Scripts/BGMPlayer.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Godot;
|
||||||
|
|
||||||
|
public partial class BGMPlayer : AudioStreamPlayer
|
||||||
|
{
|
||||||
|
public void SetBGMFromFilepath(string path)
|
||||||
|
{
|
||||||
|
var audioStream = ResourceLoader.Load<AudioStream>(path);
|
||||||
|
if (Stream != audioStream)
|
||||||
|
Stream = audioStream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PlayBGM()
|
||||||
|
{
|
||||||
|
if (!Playing)
|
||||||
|
Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,9 @@ public partial class MainMenu : Node2D
|
|||||||
GetParent().GetNode<TextureRect>("MainMenu/UIAnimations/LoreSplash").Show();
|
GetParent().GetNode<TextureRect>("MainMenu/UIAnimations/LoreSplash").Show();
|
||||||
_player = GetTree().Root.GetNode<AnimationPlayer>("/root/Main/MainMenu/UIAnimations/AnimationPlayer");
|
_player = GetTree().Root.GetNode<AnimationPlayer>("/root/Main/MainMenu/UIAnimations/AnimationPlayer");
|
||||||
_player.Queue("IntroLore");
|
_player.Queue("IntroLore");
|
||||||
|
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
|
||||||
|
bgmPlayer.SetBGMFromFilepath("Audio/BGM/02 MovinOn.mp3");
|
||||||
|
bgmPlayer.PlayBGM();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStartButtonPressed()
|
private void OnStartButtonPressed()
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ run/main_scene="res://Scenes/Main.tscn"
|
|||||||
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
|
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
|
||||||
run/physics_ticks_per_second=60
|
run/physics_ticks_per_second=60
|
||||||
|
|
||||||
|
[autoload]
|
||||||
|
|
||||||
|
BgmPlayer="*res://Scripts/BGMPlayer.cs"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/size/viewport_width=1920
|
window/size/viewport_width=1920
|
||||||
|
|||||||
Reference in New Issue
Block a user