Falling rose petal effect

This commit is contained in:
2023-09-13 19:39:10 -07:00
parent 6138957524
commit ce7576731c
16 changed files with 229 additions and 49 deletions

View File

@@ -14,23 +14,28 @@ public partial class MainMenu : Node2D
{
GetParent().GetNode<TextureRect>("MainMenu/UIAnimations/LoreSplash").Show();
_animationPlayer = GetTree().Root.GetNode<AnimationPlayer>("/root/Main/MainMenu/UIAnimations/AnimationPlayer");
_animationPlayer.Queue("IntroLore");
_animationPlayer.Play("IntroLore");
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
bgmPlayer.SetBGMFromFilepath("Audio/BGM/TitleTheme.ogg");
bgmPlayer.PlayBGM();
_player1Input = new Player1Input();
_player2Input = new Player2Input();
GetNode<TextureButton>("NewGame/1Player").GrabFocus();
_animationPlayer.AnimationFinished += OnIntroAnimationFinished;
}
public override void _UnhandledInput(InputEvent @event)
{
if (Input.IsActionJustPressed(_player1Input.Fire()) || Input.IsActionJustPressed(_player2Input.Fire()))
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();
}
private void OneSinglePlayerPressed()

View File

@@ -10,7 +10,6 @@
script = ExtResource("1_6aikc")
[node name="UIAnimations" parent="." instance=ExtResource("2_erh7e")]
visible = false
[node name="NewGame" type="Control" parent="."]
layout_mode = 3

View File

@@ -35,7 +35,7 @@ public partial class StageGUI : Control
ChangeBG(player);
}
public override void _Process(double delta)
public override void _Input(InputEvent @event)
{
var playersSelecting = _gameManager.Players.Where(x => x.IsSelectingCharacter);
foreach (var player in playersSelecting)