fun stuff
This commit is contained in:
@@ -12,48 +12,48 @@ public partial class MainMenu : Node2D
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
GetParent().GetNode<TextureRect>("MainMenu/UIAnimations/LoreSplash").Show();
|
||||
_animationPlayer = GetTree().Root.GetNode<AnimationPlayer>("/root/Main/MainMenu/UIAnimations/AnimationPlayer");
|
||||
_animationPlayer.Play("IntroLore");
|
||||
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
|
||||
bgmPlayer.SetBGMFromFilepath("Audio/BGM/TitleTheme.ogg");
|
||||
bgmPlayer.PlayBGM();
|
||||
_player1Input = new Player1Input();
|
||||
_player2Input = new Player2Input();
|
||||
_animationPlayer.AnimationFinished += OnIntroAnimationFinished;
|
||||
GetParent().GetNode<TextureRect>("MainMenu/UIAnimations/LoreSplash").Show();
|
||||
_animationPlayer = GetTree().Root.GetNode<AnimationPlayer>("/root/Main/MainMenu/UIAnimations/AnimationPlayer");
|
||||
_animationPlayer.Play("IntroLore");
|
||||
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
|
||||
bgmPlayer.SetBGMFromFilepath("Audio/BGM/TitleTheme.ogg");
|
||||
bgmPlayer.PlayBGM();
|
||||
_player1Input = new Player1Input();
|
||||
_player2Input = new Player2Input();
|
||||
_animationPlayer.AnimationFinished += OnIntroAnimationFinished;
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (_animationPlayer.IsPlaying() && (Input.IsActionJustPressed(_player1Input.Fire()) || Input.IsActionJustPressed(_player2Input.Fire())))
|
||||
{
|
||||
_animationPlayer.Seek(10);
|
||||
GetNode<TextureButton>("NewGame/1Player").GrabFocus();
|
||||
}
|
||||
if (_animationPlayer.IsPlaying() && (Input.IsActionJustPressed(_player1Input.Fire()) || Input.IsActionJustPressed(_player2Input.Fire())))
|
||||
{
|
||||
_animationPlayer.Seek(10);
|
||||
GetNode<TextureButton>("NewGame/1Player").GrabFocus();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnIntroAnimationFinished(StringName animationName)
|
||||
{
|
||||
GetNode<TextureButton>("NewGame/1Player").GrabFocus();
|
||||
GetNode<TextureButton>("NewGame/1Player").GrabFocus();
|
||||
}
|
||||
|
||||
|
||||
private void OneSinglePlayerPressed()
|
||||
{
|
||||
Hide();
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadLevel(0, 1);
|
||||
Hide();
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadLevel(0, 1);
|
||||
}
|
||||
|
||||
private void OnTwoPlayerPressed()
|
||||
{
|
||||
Hide();
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadLevel(0, 2);
|
||||
Hide();
|
||||
var main = GetTree().Root.GetNode<Main>("/root/Main");
|
||||
main.LoadLevel(0, 2);
|
||||
}
|
||||
|
||||
private void OnQuitButtonPressed()
|
||||
{
|
||||
GetTree().Quit();
|
||||
GetTree().Quit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user