Trying to fix spawn issues
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Godot;
|
||||
using System.Linq;
|
||||
using static Godot.Projection;
|
||||
|
||||
public partial class StageGUI : Control
|
||||
{
|
||||
@@ -37,41 +38,39 @@ public partial class StageGUI : Control
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
var playersCurrentlySelecting = _gameManager.Players.Where(x => x.IsSelectingCharacter);
|
||||
foreach (var player in playersCurrentlySelecting)
|
||||
if (_gameManager.Players.ElementAt(0).IsSelectingCharacter)
|
||||
{
|
||||
if (player == _gameManager.Players.ElementAt(0))
|
||||
{
|
||||
if (Input.IsActionJustPressed("p1_right"))
|
||||
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(0));
|
||||
if (Input.IsActionJustPressed("p1_left"))
|
||||
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(0));
|
||||
if (Input.IsActionJustPressed("p1_right"))
|
||||
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(0));
|
||||
if (Input.IsActionJustPressed("p1_left"))
|
||||
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(0));
|
||||
|
||||
if (Input.IsActionJustPressed("p1_fire"))
|
||||
{
|
||||
GD.Print("Selected character");
|
||||
_gameManager.Players.ElementAt(0).IsSelectingCharacter = false;
|
||||
var wheel1 = GetNode<TextureRect>("CharacterSelect/Wheel");
|
||||
wheel1.Hide();
|
||||
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(0));
|
||||
}
|
||||
if (Input.IsActionJustPressed("p1_fire"))
|
||||
{
|
||||
GD.Print("Selected character");
|
||||
_gameManager.Players.ElementAt(0).IsSelectingCharacter = false;
|
||||
var wheel1 = GetNode<TextureRect>("CharacterSelect/Wheel");
|
||||
wheel1.Hide();
|
||||
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(0));
|
||||
GetTree().Paused = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (_gameManager.Players.Count() == 2 && player == _gameManager.Players.ElementAt(1))
|
||||
if (_gameManager.Players.Count() == 2 && _gameManager.Players.ElementAt(0).IsSelectingCharacter)
|
||||
{
|
||||
if (Input.IsActionJustPressed("p2_right"))
|
||||
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(1));
|
||||
if (Input.IsActionJustPressed("p2_left"))
|
||||
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(1));
|
||||
|
||||
if (Input.IsActionJustPressed("p2_fire"))
|
||||
{
|
||||
if (Input.IsActionJustPressed("p2_right"))
|
||||
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(1));
|
||||
if (Input.IsActionJustPressed("p2_left"))
|
||||
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(1));
|
||||
|
||||
if (Input.IsActionJustPressed("p2_fire"))
|
||||
{
|
||||
GD.Print("Selected character");
|
||||
_gameManager.Players.ElementAt(1).IsSelectingCharacter = false;
|
||||
var wheel2 = GetNode<TextureRect>("CharacterSelect/Wheel2");
|
||||
wheel2.Hide();
|
||||
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(1));
|
||||
}
|
||||
GD.Print("Selected character");
|
||||
_gameManager.Players.ElementAt(1).IsSelectingCharacter = false;
|
||||
var wheel2 = GetNode<TextureRect>("CharacterSelect/Wheel2");
|
||||
wheel2.Hide();
|
||||
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(1));
|
||||
GetTree().Paused = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user