Beeg checkin

This commit is contained in:
2023-09-06 03:49:16 -07:00
parent f180d4cacd
commit f8cca640a6
320 changed files with 2751 additions and 26682 deletions

View File

@@ -0,0 +1,103 @@
using Godot;
using System.Linq;
public partial class CharacterSelectUpdateService : Control
{
public override void _Ready()
{
base._Ready();
}
public void OnCapricornP1Selected()
{
var allPortraits = GetNode<Control>("P1").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P1/CapBG");
node.Show();
}
public void OnPiscesP1Selected()
{
var allPortraits = GetNode<Control>("P1").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P1/PiscesBG");
node.Show();
}
public void OnSagP1Selected()
{
var allPortraits = GetNode<Control>("P1").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P1/SagBG");
node.Show();
}
public void OnScorpioP1Selected()
{
var allPortraits = GetNode<Control>("P1").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P1/ScorpioBG");
node.Show();
}
public void OnCapricornP2Selected()
{
var allPortraits = GetNode<Control>("P2").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P2/CapBG");
node.Show();
}
public void OnPiscesP2Selected()
{
var allPortraits = GetNode<Control>("P2").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P2/PiscesBG");
node.Show();
}
public void OnSagP2Selected()
{
var allPortraits = GetNode<Control>("P2").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P2/SagBG");
node.Show();
}
public void OnScorpioP2Selected()
{
var allPortraits = GetNode<Control>("P2").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
var node = GetNode<TextureRect>("P2/ScorpioBG");
node.Show();
}
public void OnP1GameOver()
{
var allPortraits = GetNode<Control>("P1").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
}
public void OnP2GameOver()
{
var allPortraits = GetNode<Control>("P2").GetChildren().OfType<TextureRect>();
foreach (var bg in allPortraits)
bg.Hide();
}
}

BIN
UI/Game_Over.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

34
UI/Game_Over.jpg.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dveeywi80ux2l"
path="res://.godot/imported/Game_Over.jpg-47a30a48f0fab43592563e90cc382793.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://UI/Game_Over.jpg"
dest_files=["res://.godot/imported/Game_Over.jpg-47a30a48f0fab43592563e90cc382793.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

56
UI/MainMenu.cs Normal file
View File

@@ -0,0 +1,56 @@
using Godot;
public partial class MainMenu : Node2D
{
private AnimationPlayer _animationPlayer;
[Signal]
public delegate void IntroAnimationsCompletedEventHandler();
public override void _Ready()
{
GetParent().GetNode<TextureRect>("MainMenu/UIAnimations/LoreSplash").Show();
_animationPlayer = GetTree().Root.GetNode<AnimationPlayer>("/root/Main/MainMenu/UIAnimations/AnimationPlayer");
_animationPlayer.Queue("IntroLore");
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
bgmPlayer.SetBGMFromFilepath("Audio/BGM/TitleTheme.wav");
bgmPlayer.PlayBGM();
}
private void OnSinglePlayerPressed()
{
_animationPlayer.Play("FirstLevel");
Hide();
_animationPlayer.AnimationFinished += OnAnimationFinishedCallSinglePlayerStart;
}
private void OnAnimationFinishedCallSinglePlayerStart(StringName animationName)
{
if (animationName == "FirstLevel")
{
var main = GetTree().Root.GetNode<Main>("/root/Main");
main.LoadLevel(0, 1);
}
}
private void OnTwoPlayerPressed()
{
_animationPlayer.Play("FirstLevel");
Hide();
_animationPlayer.AnimationFinished += OnAnimationFinishedCallTwoPlayerStart;
}
private void OnQuitButtonPressed()
{
GetTree().Quit();
}
private void OnAnimationFinishedCallTwoPlayerStart(StringName animationName)
{
if (animationName == "FirstLevel")
{
var main = GetTree().Root.GetNode<Main>("/root/Main");
main.LoadLevel(0, 2);
}
}
}

61
UI/MainMenu.tscn Normal file
View File

@@ -0,0 +1,61 @@
[gd_scene load_steps=4 format=3 uid="uid://b12gq4yqc3d8i"]
[ext_resource type="Script" path="res://UI/MainMenu.cs" id="1_6aikc"]
[ext_resource type="PackedScene" uid="uid://cjl20bs56430j" path="res://Animations/UIAnimations.tscn" id="2_erh7e"]
[ext_resource type="Texture2D" uid="uid://swxqmtawd1yo" path="res://Textures/GUI/TITLE-SCREEN-01.png" id="4_0156s"]
[node name="MainMenu" type="Node2D"]
script = ExtResource("1_6aikc")
[node name="UIAnimations" parent="." instance=ExtResource("2_erh7e")]
[node name="NewGame" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="TextureRect" type="TextureRect" parent="NewGame"]
layout_mode = 0
offset_right = 1920.0
offset_bottom = 1080.0
texture = ExtResource("4_0156s")
[node name="Button" type="Button" parent="NewGame"]
modulate = Color(1, 1, 1, 0)
layout_mode = 0
offset_left = 432.0
offset_top = 597.0
offset_right = 845.0
offset_bottom = 723.0
text = "
"
flat = true
[node name="Button2" type="Button" parent="NewGame"]
modulate = Color(1, 1, 1, 0)
layout_mode = 0
offset_left = 1061.0
offset_top = 598.0
offset_right = 1485.0
offset_bottom = 720.0
text = "
"
flat = true
[node name="Button3" type="Button" parent="NewGame"]
modulate = Color(1, 1, 1, 0)
layout_mode = 0
offset_left = 748.0
offset_top = 822.0
offset_right = 1172.0
offset_bottom = 944.0
text = "
"
flat = true
[connection signal="pressed" from="NewGame/Button" to="." method="OnSinglePlayerPressed"]
[connection signal="pressed" from="NewGame/Button2" to="." method="OnTwoPlayerPressed"]
[connection signal="pressed" from="NewGame/Button3" to="." method="OnQuitButtonPressed"]

154
UI/StageGUI.cs Normal file
View File

@@ -0,0 +1,154 @@
using Godot;
using System.Linq;
public partial class StageGUI : Control
{
[Signal]
public delegate void OnCharacterSelectionMadeEventHandler(PlayerManager player);
[Signal]
public delegate void CapricornP1SelectedEventHandler();
[Signal]
public delegate void CapricornP2SelectedEventHandler();
[Signal]
public delegate void PiscesP1SelectedEventHandler();
[Signal]
public delegate void PiscesP2SelectedEventHandler();
[Signal]
public delegate void SagP1SelectedEventHandler();
[Signal]
public delegate void SagP2SelectedEventHandler();
[Signal]
public delegate void ScorpioP1SelectedEventHandler();
[Signal]
public delegate void ScorpioP2SelectedEventHandler();
[Signal]
public delegate void OnP1GameOverEventHandler();
[Signal]
public delegate void OnP2GameOverEventHandler();
[Signal]
public delegate void OnGameOverEventHandler();
private GameManager _gameManager;
public override void _Ready()
{
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
public void OnCharacterSelect(PlayerManager player)
{
if (player.GameOver)
return;
player.IsSelectingCharacter = true;
ChangeBG(player);
}
public override void _Process(double delta)
{
if (_gameManager.Players.ElementAt(0).IsSelectingCharacter)
{
if (Input.IsActionJustPressed("p1_right"))
{
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(0));
ChangeBG(_gameManager.Players.ElementAt(0));
}
if (Input.IsActionJustPressed("p1_left"))
{
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(0));
ChangeBG(_gameManager.Players.ElementAt(0));
}
if (Input.IsActionJustPressed("p1_fire"))
{
GD.Print("Selected character");
_gameManager.Players.ElementAt(0).IsSelectingCharacter = false;
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(0));
GetTree().Paused = false;
}
}
if (_gameManager.Players.Count() == 2 && _gameManager.Players.ElementAt(0).IsSelectingCharacter)
{
if (Input.IsActionJustPressed("p2_right"))
{
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(1));
ChangeBG(_gameManager.Players.ElementAt(1));
}
if (Input.IsActionJustPressed("p2_left"))
{
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(1));
ChangeBG(_gameManager.Players.ElementAt(1));
}
if (Input.IsActionJustPressed("p2_fire"))
{
GD.Print("Selected character");
_gameManager.Players.ElementAt(1).IsSelectingCharacter = false;
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(1));
GetTree().Paused = false;
}
}
if (_gameManager.Players.ElementAt(0).GameOver)
EmitSignal(SignalName.OnP1GameOver);
if (_gameManager.Players.Count() == 2 && _gameManager.Players.ElementAt(0).GameOver)
EmitSignal(SignalName.OnP1GameOver);
if (_gameManager.Players.All(x => x.GameOver))
{
EmitSignal(SignalName.OnGameOver);
GetNode<Control>("GameOver").Show();
var bgmPlayer = GetTree().Root.GetNode<BGMPlayer>("BgmPlayer");
bgmPlayer.SetBGMFromFilepath("Audio/BGM/GameOverTheme.wav");
bgmPlayer.PlayBGM();
}
}
private void ChangeBG(PlayerManager player)
{
var name = player.CharactersLeftOnStage.ElementAt(player._characterIndex).Name;
GD.Print(name);
switch (name)
{
case "CapricornP1":
EmitSignal(SignalName.CapricornP1Selected);
break;
case "CapricornP2":
EmitSignal(SignalName.CapricornP2Selected);
break;
case "ScorpioP1":
EmitSignal(SignalName.ScorpioP1Selected);
break;
case "ScorpioP2":
EmitSignal(SignalName.ScorpioP2Selected);
break;
case "PiscesP1":
EmitSignal(SignalName.PiscesP1Selected);
break;
case "PiscesP2":
EmitSignal(SignalName.PiscesP2Selected);
break;
case "MegamiP1":
EmitSignal(SignalName.SagP1Selected);
break;
case "MegamiP2":
EmitSignal(SignalName.SagP2Selected);
break;
default:
break;
}
}
private void OnFirstPlayerCharacterSelect()
{
var player = _gameManager.Players.ElementAt(0);
OnCharacterSelect(player);
}
private void OnSecondPlayerCharacterSelect()
{
var player = _gameManager.Players.ElementAt(1);
OnCharacterSelect(player);
}
}

214
UI/StageGUI.tscn Normal file
View File

@@ -0,0 +1,214 @@
[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"]
[ext_resource type="Script" path="res://UI/CharacterSelectUpdateService.cs" id="3_5iw21"]
[ext_resource type="Texture2D" uid="uid://c3eubpygfvc3l" path="res://Textures/Portraits/cap-bg-char.png" id="4_fuv8s"]
[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="Texture2D" uid="uid://dveeywi80ux2l" path="res://UI/Game_Over.jpg" id="8_o0pnh"]
[node name="StageGUI" type="Control"]
process_mode = 3
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_wr2m0")
metadata/_edit_horizontal_guides_ = [-342.0]
[node name="SidebarLeft" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -540.0
offset_right = 420.0
offset_bottom = 540.0
grow_vertical = 2
texture = ExtResource("2_rh3al")
[node name="SidebarRight" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -420.0
offset_top = -540.0
offset_bottom = 540.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("2_rh3al")
[node name="CharacterSelect" type="Control" parent="."]
process_mode = 3
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("3_5iw21")
[node name="P1" type="Control" parent="CharacterSelect"]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -20.0
offset_right = 40.0
offset_bottom = 20.0
grow_vertical = 2
[node name="CapBG" type="TextureRect" parent="CharacterSelect/P1"]
visible = false
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -540.0
offset_right = 420.0
offset_bottom = 540.0
grow_vertical = 2
texture = ExtResource("4_fuv8s")
stretch_mode = 2
[node name="PiscesBG" type="TextureRect" parent="CharacterSelect/P1"]
visible = false
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -540.0
offset_right = 420.0
offset_bottom = 540.0
grow_vertical = 2
texture = ExtResource("5_y2ln6")
stretch_mode = 2
[node name="SagBG" type="TextureRect" parent="CharacterSelect/P1"]
visible = false
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -540.0
offset_right = 420.0
offset_bottom = 540.0
grow_vertical = 2
texture = ExtResource("6_iltal")
stretch_mode = 2
[node name="ScorpioBG" type="TextureRect" parent="CharacterSelect/P1"]
visible = false
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -540.0
offset_right = 420.0
offset_bottom = 540.0
grow_vertical = 2
texture = ExtResource("7_tgrf5")
stretch_mode = 2
[node name="P2" type="Control" parent="CharacterSelect"]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -40.0
offset_top = -20.0
offset_bottom = 20.0
grow_horizontal = 0
grow_vertical = 2
[node name="CapBG" type="TextureRect" parent="CharacterSelect/P2"]
visible = false
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -420.0
offset_top = -540.0
offset_bottom = 540.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("4_fuv8s")
[node name="PiscesBG" type="TextureRect" parent="CharacterSelect/P2"]
visible = false
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -420.0
offset_top = -540.0
offset_bottom = 540.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("5_y2ln6")
[node name="SagBG" type="TextureRect" parent="CharacterSelect/P2"]
visible = false
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -420.0
offset_top = -540.0
offset_bottom = 540.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("6_iltal")
[node name="ScorpioBG" type="TextureRect" parent="CharacterSelect/P2"]
visible = false
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -420.0
offset_top = -540.0
offset_bottom = 540.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("7_tgrf5")
[node name="GameOver" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="GameOverScreen" type="TextureRect" parent="GameOver"]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
texture = ExtResource("8_o0pnh")
[connection signal="CapricornP1Selected" from="." to="CharacterSelect" method="OnCapricornP1Selected"]
[connection signal="CapricornP2Selected" from="." to="CharacterSelect" method="OnCapricornP2Selected"]
[connection signal="OnP1GameOver" from="." to="CharacterSelect" method="OnP1GameOver"]
[connection signal="OnP2GameOver" from="." to="CharacterSelect" method="OnP2GameOver"]
[connection signal="PiscesP1Selected" from="." to="CharacterSelect" method="OnPiscesP1Selected"]
[connection signal="PiscesP2Selected" from="." to="CharacterSelect" method="OnPiscesP2Selected"]
[connection signal="SagP1Selected" from="." to="CharacterSelect" method="OnSagP1Selected"]
[connection signal="SagP2Selected" from="." to="CharacterSelect" method="OnSagP2Selected"]
[connection signal="ScorpioP1Selected" from="." to="CharacterSelect" method="OnScorpioP1Selected"]
[connection signal="ScorpioP2Selected" from="." to="CharacterSelect" method="OnScorpioP2Selected"]