Release Candidate v0.1

This commit is contained in:
2023-09-14 19:13:54 -07:00
parent 54b044142d
commit 7bf559a800
44 changed files with 1257 additions and 476 deletions

View File

@@ -47,10 +47,9 @@ public partial class CharacterSelectUpdateService : Control
node.Show();
}
public void ClearPlayerBGs(int playerIndex)
public void ClearPlayerBGs(Player player)
{
GD.Print($"Hiding player");
var allPortraits = GetNode<Control>($"P{playerIndex + 1}").GetChildren().OfType<TextureRect>();
var allPortraits = GetNode<Control>($"P{player.PlayerNumber}").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
}

View File

@@ -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.IsActionJustReleased(_player1Input.Fire()) || Input.IsActionJustReleased(_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();
}
}

View File

@@ -19,9 +19,12 @@ public partial class StageGUI : Control
[Signal]
public delegate void OnGameOverEventHandler(Array<Player> players);
[Export]
private AudioStreamPlayer _audioStreamPlayer;
private GameManager _gameManager;
public override void _EnterTree()
public override void _Ready()
{
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
@@ -57,6 +60,8 @@ public partial class StageGUI : Control
player.IsSelectingCharacter = false;
EmitSignal(SignalName.OnCharacterSelectionMade, player);
GetTree().Paused = false;
if (_audioStreamPlayer != null)
_audioStreamPlayer.Play();
}
}

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://dq1gtd55p04do"]
[gd_scene load_steps=9 format=3 uid="uid://dq1gtd55p04do"]
[ext_resource type="Script" path="res://UI/StageGUI.cs" id="1_wr2m0"]
[ext_resource type="Texture2D" uid="uid://d18xmfbg47qpi" path="res://Textures/Portraits/blank-background.png" id="2_rh3al"]
@@ -7,8 +7,9 @@
[ext_resource type="Texture2D" uid="uid://1pgw8he4k5va" path="res://Textures/Portraits/pisces-bg-char.png" id="5_y2ln6"]
[ext_resource type="Texture2D" uid="uid://bacwvejc4hcou" path="res://Textures/Portraits/sag-bg-char.png" id="6_iltal"]
[ext_resource type="Texture2D" uid="uid://o7uu4efxf36e" path="res://Textures/Portraits/scorpio-bg-char.png" id="7_tgrf5"]
[ext_resource type="AudioStream" uid="uid://cdps3mfvdxdud" path="res://Audio/SFX/select.wav" id="8_3x5jr"]
[node name="StageGUI" type="Control"]
[node name="StageGUI" type="Control" node_paths=PackedStringArray("_audioStreamPlayer")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@@ -16,6 +17,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_wr2m0")
_audioStreamPlayer = NodePath("AudioStreamPlayer")
metadata/_edit_horizontal_guides_ = [-342.0]
[node name="SidebarLeft" type="TextureRect" parent="."]
@@ -186,3 +188,6 @@ offset_bottom = 540.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("7_tgrf5")
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("8_3x5jr")