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,32 @@
using Godot;
using System.Linq;
public partial class AreaExit : Node3D
{
[Export]
private int _levelIndex;
private GameManager _gameManager;
public override void _Ready()
{
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
}
private void OnExitEntered(Node3D node)
{
if (node is Controls)
{
if (node.GetType() == typeof(P1Controls) || node.GetType() == typeof(CapricornP1Controls))
_gameManager.RemoveCharacterAndAddToExit((P1Controls)node);
if (node.GetType() == typeof(P2Controls) || node.GetType() == typeof(CapricornP2Controls))
_gameManager.RemoveCharacterAndAddToExit((P2Controls)node);
GD.Print("Exit reached");
if (!_gameManager.Players.Any(x => x.CharactersLeftOnStage.Any()))
_gameManager.OnLevelClear();
}
}
}